Rename "Version String Extraction" to "Trim Version String" for non-HTML Sources (#1723)

Rename Codeberg to Forgejo (#1722)
This commit is contained in:
Imran Remtulla
2024-07-14 20:20:41 -04:00
parent 77618ad1ff
commit d1cb2688c6
27 changed files with 439 additions and 379 deletions

View File

@@ -5,6 +5,7 @@ import 'package:obtainium/providers/source_provider.dart';
class Codeberg extends AppSource {
GitHub gh = GitHub();
Codeberg() {
name = 'Forgejo (Codeberg)';
hosts = ['codeberg.org'];
additionalSourceAppSpecificSettingFormItems =

View File

@@ -93,6 +93,21 @@ bool _isNumeric(String s) {
}
class HTML extends AppSource {
@override
List<List<GeneratedFormItem>> get combinedAppSpecificSettingFormItems {
return super.combinedAppSpecificSettingFormItems.map((r) {
return r.map((e) {
if (e.key == 'versionExtractionRegEx') {
e.label = tr('versionExtractionRegEx');
}
if (e.key == 'matchGroupToUse') {
e.label = tr('matchGroupToUse');
}
return e;
}).toList();
}).toList();
}
var finalStepFormitems = [
[
GeneratedFormTextField('customLinkFilterRegex',

View File

@@ -493,13 +493,15 @@ abstract class AppSource {
],
[
GeneratedFormTextField('versionExtractionRegEx',
label: tr('versionExtractionRegEx'),
label: tr('trimVersionString'),
required: false,
additionalValidators: [(value) => regExValidator(value)]),
],
[
GeneratedFormTextField('matchGroupToUse',
label: tr('matchGroupToUse'), required: false, hint: '\$0')
label: tr('matchGroupToUseForX', args: [tr('trimVersionString')]),
required: false,
hint: '\$0')
],
[
GeneratedFormSwitch('versionDetection',