Skip to content

Commit

Permalink
Merge pull request #1439 from ImranR98/dev
Browse files Browse the repository at this point in the history
- Allow any source to be overridden (#1420)
- Bugfix for installing apps with ID change step (#1424)
- Bugfix: 'null' changelog for some track-only apps (#1425)
- Show latest APK name/count on app page (#1426)
- More BG update interval options (#1431)
  • Loading branch information
ImranR98 authored Mar 2, 2024
2 parents 90e6e5a + afc0c3a commit 59cc08f
Show file tree
Hide file tree
Showing 27 changed files with 131 additions and 73 deletions.
5 changes: 4 additions & 1 deletion assets/translations/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Uklonite zastarjeli filter aplikacija",
"showOutdatedOnly": "Prikaži samo zastarjele aplikacije",
"filter": "Filtriranje",
"filterActive": "Filtriranje",
"filterApps": "Filtriraj aplikacije",
"appName": "Naziv aplikacije",
"author": "Autor",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} i još jedna aplikacija je vjerovatno ažurirana.",
"other": "{} i još {} aplikacija su vjerovatno ažurirane."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Odstranit filtr Neaktuální",
"showOutdatedOnly": "Zobrazovat pouze zastaralé aplikace",
"filter": "Filtr",
"filterActive": "Filtr *",
"filterApps": "Filtrovat aplikace",
"appName": "Název aplikace",
"author": "Autor",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} a 1 další aplikace možno aktualizovat",
"other": "{} a {} další aplikace mohou být aktualizovány."
},
"apk": {
"one": "{} APK",
"other": "{} APK"
}
}
5 changes: 4 additions & 1 deletion assets/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "App-Filter ‚Nicht aktuell‘ entfernen",
"showOutdatedOnly": "Nur nicht aktuelle Apps anzeigen",
"filter": "Filter",
"filterActive": "Filter *",
"filterApps": "Apps filtern",
"appName": "App Name",
"author": "Autor",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} und 1 weitere Anwendung wurden möglicherweise aktualisiert.",
"other": "{} und {} weitere Anwendungen wurden möglicherweise aktualisiert."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
4 changes: 4 additions & 0 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} and 1 more app may have been updated.",
"other": "{} and {} more apps may have been updated."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Elimiar filtro de aplicaciones desactualizado",
"showOutdatedOnly": "Mostrar solo aplicaciones desactualizadas",
"filter": "Filtrar",
"filterActive": "Filtrar *",
"filterApps": "Filtrar Actualizaciones",
"appName": "Nombre de la aplicación",
"author": "Autor",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} y 1 aplicación más podría haber sido actualizada.",
"other": "{} y {} aplicaciones más podrían haber sido actualizadas."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "فیلتر برنامه قدیمی را حذف کنید",
"showOutdatedOnly": "فقط برنامه های قدیمی را نشان دهید",
"filter": "فیلتر",
"filterActive": "فیلتر *",
"filterApps": "فیلتر کردن برنامه ها",
"appName": "نام برنامه",
"author": "سازنده",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} و 1 برنامه دیگر ممکن است به روز شده باشند.",
"other": "ممکن است {} و {} برنامه های دیگر به روز شده باشند."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Supprimer le filtre d'application obsolète",
"showOutdatedOnly": "Afficher uniquement les applications obsolètes",
"filter": "Filtre",
"filterActive": "Filtre *",
"filterApps": "Filtrer les applications",
"appName": "Nom de l'application",
"author": "Auteur",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"une": "{} et 1 application supplémentaire ont peut-être été mises à jour.",
"other": "{} et {} autres applications peuvent avoir été mises à jour."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Távolítsa el az elavult app szűrőt",
"showOutdatedOnly": "Csak az elavult appok megjelenítése",
"filter": "Szűrő",
"filterActive": "Szűrő *",
"filterApps": "Appok szűrése",
"appName": "App név",
"author": "Szerző",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} és 1 további alkalmazás is frissült.",
"other": "{} és {} további alkalmazás is frissült."
},
"apk": {
"one": "{} APK",
"other": "{} APK-k"
}
}
5 changes: 4 additions & 1 deletion assets/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Rimuovi il filtro per le app non aggiornate",
"showOutdatedOnly": "Mostra solo le app non aggiornate",
"filter": "Filtri",
"filterActive": "Filtri *",
"filterApps": "Filtra app",
"appName": "Nome dell'app",
"author": "Autore",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} e un'altra app potrebbero essere state aggiornate.",
"other": "{} e altre {} app potrebbero essere state aggiornate."
},
"apk": {
"one": "{} APK",
"other": "{} APK"
}
}
5 changes: 4 additions & 1 deletion assets/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "アップデートが存在するアプリのフィルターを解除",
"showOutdatedOnly": "アップデートが存在するアプリのみ表示する",
"filter": "フィルター",
"filterActive": "フィルター *",
"filterApps": "アプリをフィルタリングする",
"appName": "アプリ名",
"author": "作者",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} とさらに 1 個のアプリがアップデートされた可能性があります。",
"other": "{} とさらに {} 個のアプリがアップデートされた可能性があります。"
},
"apk": {
"one": "{}APK",
"other": "{}APK"
}
}
5 changes: 4 additions & 1 deletion assets/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Verwijder out-of-date app filter",
"showOutdatedOnly": "Toon alleen out-of-date apps",
"filter": "Filter",
"filterActive": "Filteren *",
"filterApps": "Filter apps",
"appName": "App naam",
"author": "Auteur",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} en nog 1 app zijn mogelijk bijgewerkt.",
"other": "{} en {} meer apps zijn mogelijk bijgwerkt."
},
"apk": {
"one": "{} APK",
"other": "{} APK's"
}
}
5 changes: 4 additions & 1 deletion assets/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Usuń filtr nieaktualnych aplikacji",
"showOutdatedOnly": "Pokaż tylko nieaktualne aplikacje",
"filter": "FIltr",
"filterActive": "Filtruj *",
"filterApps": "Filtruj aplikacje",
"appName": "Nazwa aplikacji",
"author": "Autor",
Expand Down Expand Up @@ -378,5 +377,9 @@
"few": "{} i {} inne apki mogły zostać zaktualizowane.",
"many": "{} i {} innych apek mogło zostać zaktualizowanych.",
"other": "{} i {} inne apki mogły zostać zaktualizowane."
},
"apk": {
"one": "{} APK",
"other": "{} APK"
}
}
5 changes: 4 additions & 1 deletion assets/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Remover filtro de aplicativos desatualizados",
"showOutdatedOnly": "Mostrar apenas aplicativos desatualizados",
"filter": "Filtro",
"filterActive": "Filtro *",
"filterApps": "Filtrar aplicativos",
"appName": "Nome do aplicativo",
"author": "Autor",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} e um outro aplicativo podem ter sido atualizados.",
"other": "{} e {} outros aplicativos podem ter sido atualizados."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Удалить фильтр для устаревших приложений",
"showOutdatedOnly": "Показывать только устаревшие приложения",
"filter": "Фильтр",
"filterActive": "Фильтр *",
"filterApps": "Фильтровать приложения",
"appName": "Название приложения",
"author": "Автор",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} и ещё 1 приложение могли быть обновлены",
"other": "{} и ещё {} приложений могли быть обновлены"
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
7 changes: 3 additions & 4 deletions assets/translations/standardize.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ const main = async () => {
return `${translationsDir}/${f}`
}).filter(f => f.endsWith('.json') && f != templateFile)

const templateTranslation = require(templateFile)

const templateTranslation = JSON.parse(fs.readFileSync(templateFile).toString())

otherFiles.forEach(file => {
const thisTranslationOriginal = require(file)
const thisTranslationOriginal = JSON.parse(fs.readFileSync((file).toString()))
const thisTranslationNew = {}
Object.keys(templateTranslation).forEach(k => {
thisTranslationNew[k] = thisTranslationOriginal[k] || templateTranslation[k]
Expand All @@ -72,7 +71,7 @@ const main = async () => {

for (let i in otherFiles) {
const file = otherFiles[i]
const thisTranslation = require(file)
const thisTranslation = JSON.parse(fs.readFileSync((file).toString()))
const translationKeys = Object.keys(templateTranslation)
for (let j in translationKeys) {
const k = translationKeys[j]
Expand Down
5 changes: 4 additions & 1 deletion assets/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Ta bort Utgånga App-filtret",
"showOutdatedOnly": "Visa Endast Utgånga Appar",
"filter": "Filtrera",
"filterActive": "Filter *",
"filterApps": "Filtrera Appar",
"appName": "Appnamn",
"author": "Utvecklare",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} och 1 till app kan ha uppdaterats.",
"other": "{} och {} appar till kan ha uppdaterats."
},
"apk": {
"one": "{} APK",
"other": "{} APK:er"
}
}
5 changes: 4 additions & 1 deletion assets/translations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "Güncel Olmayan Uygulama Filtresini Kaldır",
"showOutdatedOnly": "Yalnızca Güncel Olmayan Uygulamaları Göster",
"filter": "Filtre",
"filterActive": "Filtre *",
"filterApps": "Uygulamaları Filtrele",
"appName": "Uygulama Adı",
"author": "Yazar",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} ve 1 diğer uygulama muhtemelen güncellendi.",
"other": "{} ve {} daha fazla uygulama muhtemelen güncellendi."
},
"apk": {
"one": "{} APK",
"other": "{} APK'lar"
}
}
4 changes: 4 additions & 0 deletions assets/translations/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -351,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} và 1 ứng dụng khác có thể đã được cập nhật.",
"other": "{} và {} ứng dụng khác có thể đã được cập nhật."
},
"apk": {
"one": "{} APK",
"other": "{} APKs"
}
}
5 changes: 4 additions & 1 deletion assets/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"removeOutdatedFilter": "删除失效的应用筛选",
"showOutdatedOnly": "只显示待更新应用",
"filter": "筛选",
"filterActive": "筛选 *",
"filterApps": "筛选应用",
"appName": "应用名称",
"author": "作者",
Expand Down Expand Up @@ -352,5 +351,9 @@
"xAndNMoreUpdatesPossiblyInstalled": {
"one": "{} 和另外 1 个应用已尝试更新。",
"other": "“{}”和另外 {} 个应用已尝试更新。"
},
"apk": {
"one": "{}APK",
"other": "{}APK"
}
}
2 changes: 1 addition & 1 deletion lib/app_sources/github.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class GitHub extends AppSource {
if (version == null) {
throw NoVersionError();
}
var changeLog = targetRelease['body'].toString();
var changeLog = (targetRelease['body'] ?? '').toString();
return APKDetails(
version,
targetRelease['apkUrls'] as List<MapEntry<String, String>>,
Expand Down
22 changes: 3 additions & 19 deletions lib/pages/add_app.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:obtainium/app_sources/html.dart';
import 'package:obtainium/components/custom_app_bar.dart';
import 'package:obtainium/components/generated_form.dart';
import 'package:obtainium/components/generated_form_modal.dart';
Expand Down Expand Up @@ -62,18 +61,6 @@ class AddAppPageState extends State<AddAppPage> {
var prevHost = pickedSource?.hosts.isNotEmpty == true
? pickedSource?.hosts[0]
: null;
try {
var naturalSource =
valid ? sourceProvider.getSource(userInput) : null;
if (naturalSource != null &&
naturalSource.runtimeType.toString() !=
HTML().runtimeType.toString()) {
// If input has changed to match a regular source, reset the override
pickedSourceOverride = null;
}
} catch (e) {
// ignore
}
var source = valid
? sourceProvider.getSource(userInput,
overrideSource: pickedSourceOverride)
Expand Down Expand Up @@ -361,8 +348,9 @@ class AddAppPageState extends State<AddAppPage> {
[
GeneratedFormDropdown(
'overrideSource',
defaultValue: HTML().runtimeType.toString(),
defaultValue: '',
[
MapEntry('', tr('none')),
...sourceProvider.sources.map(
(s) => MapEntry(s.runtimeType.toString(), s.name))
],
Expand Down Expand Up @@ -577,11 +565,7 @@ class AddAppPageState extends State<AddAppPage> {
const SizedBox(
height: 16,
),
if (pickedSourceOverride != null ||
(pickedSource != null &&
pickedSource.runtimeType.toString() ==
HTML().runtimeType.toString()))
getHTMLSourceOverrideDropdown(),
if (pickedSource != null) getHTMLSourceOverrideDropdown(),
if (shouldShowSearchBar()) getSearchBarRow(),
if (pickedSource != null)
FutureBuilder(
Expand Down
Loading

0 comments on commit 59cc08f

Please sign in to comment.