diff --git a/assets/translations/bs.json b/assets/translations/bs.json index 433984e..54fa76b 100644 --- a/assets/translations/bs.json +++ b/assets/translations/bs.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHub rate limiting can be avoided using an API key.", "gitlabSourceNote": "GitLab APK extraction may not work without an API key.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Želite li ukloniti aplikaciju?", "other": "Želite li ukloniti aplikacije?" diff --git a/assets/translations/de.json b/assets/translations/de.json index d7ea035..fe26fab 100644 --- a/assets/translations/de.json +++ b/assets/translations/de.json @@ -245,6 +245,7 @@ "githubSourceNote": "Die GitHub-Ratenbegrenzung kann mit einem API-Schlüssel umgangen werden.", "gitlabSourceNote": "GitLab APK-Extraktion funktioniert möglicherweise nicht ohne API-Schlüssel", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "App entfernen?", "other": "Apps entfernen?" diff --git a/assets/translations/en.json b/assets/translations/en.json index 551cdb6..2daf50e 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHub rate limiting can be avoided using an API key.", "gitlabSourceNote": "GitLab APK extraction may not work without an API key.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Remove App?", "other": "Remove Apps?" diff --git a/assets/translations/es.json b/assets/translations/es.json index b7aae29..76bddc6 100644 --- a/assets/translations/es.json +++ b/assets/translations/es.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHub rate limiting can be avoided using an API key.", "gitlabSourceNote": "GitLab APK extraction may not work without an API key.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "¿Eliminar Aplicación?", "other": "¿Eliminar Aplicaciones?" diff --git a/assets/translations/fa.json b/assets/translations/fa.json index a7dace4..342d98d 100644 --- a/assets/translations/fa.json +++ b/assets/translations/fa.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHub rate limiting can be avoided using an API key.", "gitlabSourceNote": "GitLab APK extraction may not work without an API key.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "برنامه حذف شود؟", "other": "برنامه ها حذف شوند؟" diff --git a/assets/translations/fr.json b/assets/translations/fr.json index 0a8cfbf..32d1e35 100644 --- a/assets/translations/fr.json +++ b/assets/translations/fr.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHub rate limiting can be avoided using an API key.", "gitlabSourceNote": "GitLab APK extraction may not work without an API key.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Supprimer l'application ?", "other": "Supprimer les applications ?" diff --git a/assets/translations/hu.json b/assets/translations/hu.json index 6498b44..ab5be1f 100644 --- a/assets/translations/hu.json +++ b/assets/translations/hu.json @@ -244,6 +244,7 @@ "githubSourceNote": "A GitHub értékelési korlátozása elkerülhető API-kulcs használatával.", "gitlabSourceNote": "Előfordulhat, hogy a GitLab APK kibontása nem működik API-kulcs nélkül.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Eltávolítja az alkalmazást?", "other": "Eltávolítja az alkalmazást?" diff --git a/assets/translations/it.json b/assets/translations/it.json index 49eec85..be3e441 100644 --- a/assets/translations/it.json +++ b/assets/translations/it.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHub rate limiting can be avoided using an API key.", "gitlabSourceNote": "GitLab APK extraction may not work without an API key.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Rimuovere l'app?", "other": "Rimuovere le app?" diff --git a/assets/translations/ja.json b/assets/translations/ja.json index 528469a..a89fc20 100644 --- a/assets/translations/ja.json +++ b/assets/translations/ja.json @@ -245,6 +245,7 @@ "githubSourceNote": "GitHubのレート制限はAPIキーを使うことで回避できます。", "gitlabSourceNote": "GitLabのAPK抽出はAPIキーがないと動作しない場合があります。", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "アプリを削除しますか?", "other": "アプリを削除しますか?" diff --git a/assets/translations/pl.json b/assets/translations/pl.json index 3b73db6..be2f699 100644 --- a/assets/translations/pl.json +++ b/assets/translations/pl.json @@ -249,6 +249,7 @@ "githubSourceNote": "Limit żądań GitHub można ominąć za pomocą klucza API.", "gitlabSourceNote": "Pozyskiwanie pliku APK z GitLab może nie działać bez klucza API.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Usunąć aplikację?", "other": "Usunąć aplikacje?" diff --git a/assets/translations/ru.json b/assets/translations/ru.json index 6330f01..94a6ebf 100644 --- a/assets/translations/ru.json +++ b/assets/translations/ru.json @@ -245,6 +245,7 @@ "githubSourceNote": "Лимит запросов GitHub можно обойти, используя ключ API.", "gitlabSourceNote": "Извлечение APK из GitLab может не работать без ключа API.", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "Удалить приложение?", "other": "Удалить приложения?" diff --git a/assets/translations/zh.json b/assets/translations/zh.json index be03d5b..e59296d 100644 --- a/assets/translations/zh.json +++ b/assets/translations/zh.json @@ -245,6 +245,7 @@ "githubSourceNote": "使用访问令牌可避免触发 GitHub 的 API 请求限制。", "gitlabSourceNote": "未使用访问令牌时可能无法从 GitLab 获取 APK 文件。", "sortByFileNamesNotLinks": "Sort by file names instead of full links", + "filterReleaseNotesByRegEx": "Filter Release Notes by Regular Expression", "removeAppQuestion": { "one": "是否删除应用?", "other": "是否删除应用?" diff --git a/lib/app_sources/codeberg.dart b/lib/app_sources/codeberg.dart index 8e9ef04..df06b9f 100644 --- a/lib/app_sources/codeberg.dart +++ b/lib/app_sources/codeberg.dart @@ -1,6 +1,4 @@ -import 'package:easy_localization/easy_localization.dart'; import 'package:obtainium/app_sources/github.dart'; -import 'package:obtainium/components/generated_form.dart'; import 'package:obtainium/custom_errors.dart'; import 'package:obtainium/providers/source_provider.dart'; @@ -9,26 +7,8 @@ class Codeberg extends AppSource { Codeberg() { host = 'codeberg.org'; - additionalSourceAppSpecificSettingFormItems = [ - [ - GeneratedFormSwitch('includePrereleases', - label: tr('includePrereleases'), defaultValue: false) - ], - [ - GeneratedFormSwitch('fallbackToOlderReleases', - label: tr('fallbackToOlderReleases'), defaultValue: true) - ], - [ - GeneratedFormTextField('filterReleaseTitlesByRegEx', - label: tr('filterReleaseTitlesByRegEx'), - required: false, - additionalValidators: [ - (value) { - return regExValidator(value); - } - ]) - ] - ]; + additionalSourceAppSpecificSettingFormItems = + gh.additionalSourceAppSpecificSettingFormItems; canSearch = true; searchQuerySettingFormItems = gh.searchQuerySettingFormItems; diff --git a/lib/app_sources/github.dart b/lib/app_sources/github.dart index b6a5e2d..608c31c 100644 --- a/lib/app_sources/github.dart +++ b/lib/app_sources/github.dart @@ -75,6 +75,16 @@ class GitHub extends AppSource { return regExValidator(value); } ]) + ], + [ + GeneratedFormTextField('filterReleaseNotesByRegEx', + label: tr('filterReleaseNotesByRegEx'), + required: false, + additionalValidators: [ + (value) { + return regExValidator(value); + } + ]) ] ]; @@ -196,6 +206,12 @@ class GitHub extends AppSource { true ? additionalSettings['filterReleaseTitlesByRegEx'] : null; + String? regexNotesFilter = + (additionalSettings['filterReleaseNotesByRegEx'] as String?) + ?.isNotEmpty == + true + ? additionalSettings['filterReleaseNotesByRegEx'] + : null; Response res = await sourceRequest(requestUrl); if (res.statusCode == 200) { var releases = jsonDecode(res.body) as List; @@ -264,6 +280,11 @@ class GitHub extends AppSource { !RegExp(regexFilter).hasMatch(nameToFilter.trim())) { continue; } + if (regexNotesFilter != null && + !RegExp(regexNotesFilter) + .hasMatch(((releases[i]['body'] as String?) ?? '').trim())) { + continue; + } var apkUrls = getReleaseAPKUrls(releases[i]); if (apkUrls.isEmpty && additionalSettings['trackOnly'] != true) { continue;