Compare commits

...

12 Commits

Author SHA1 Message Date
Imran Remtulla
d9225fd639 Merge pull request #712 from ImranR98/dev
Auto retry failed download (3 times) (#634)
2023-07-23 15:03:34 -04:00
Imran Remtulla
995d44551c Auto retry failed download (3 times) (#634) 2023-07-23 15:02:58 -04:00
Imran Remtulla
68c0224b98 Merge pull request #711 from ImranR98/dev
Increment version, update modules
2023-07-23 14:26:48 -04:00
Imran Remtulla
7767468d5d Increment version, update modules 2023-07-23 14:26:22 -04:00
Imran Remtulla
f9f83d8243 Merge pull request #710 from ImranR98/dev
Fix empty error messages for HTTP errors
2023-07-23 14:24:50 -04:00
Imran Remtulla
cc4cec829f Merge pull request #705 from gidano/main
Update hu.json
2023-07-23 14:24:23 -04:00
Imran Remtulla
f665bf1eb2 Merge pull request #706 from TangyWrecker/main
Update ru.json
2023-07-23 14:24:18 -04:00
Imran Remtulla
bccd52054e Merge pull request #708 from LilligantMatsuri/main
Update Chinese translation
2023-07-23 14:24:12 -04:00
Imran Remtulla
3a4c782aab Fix empty error messages for HTTP errors 2023-07-23 14:23:34 -04:00
Matsuri
6e047e96fa Update Chinese translation
- Translate new strings

Signed-off-by: Matsuri <matsuri@vmoe.info>
2023-07-23 19:56:23 +08:00
Tangy Wrecker
42f8753166 Update ru.json 2023-07-23 14:34:15 +03:00
gidano
b6a64129b3 Update hu.json 2023-07-23 08:52:14 +02:00
8 changed files with 40 additions and 18 deletions

View File

@@ -236,9 +236,9 @@
"removeOnExternalUninstall": "A külsőleg eltávolított appok auto. eltávolítása", "removeOnExternalUninstall": "A külsőleg eltávolított appok auto. eltávolítása",
"pickHighestVersionCode": "A legmagasabb verziószámú APK auto. kiválasztása", "pickHighestVersionCode": "A legmagasabb verziószámú APK auto. kiválasztása",
"checkUpdateOnDetailPage": "Frissítések keresése az app részleteit tartalmazó oldal megnyitásakor", "checkUpdateOnDetailPage": "Frissítések keresése az app részleteit tartalmazó oldal megnyitásakor",
"disablePageTransitions": "Disable page transition animations", "disablePageTransitions": "Lap áttűnési animációk tiltása",
"reversePageTransitions": "Reverse page transition animations", "reversePageTransitions": "Fordított lap áttűnési animációk",
"minStarCount": "Minimum Star Count", "minStarCount": "Minimális csillag szám",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Eltávolítja az alkalmazást?", "one": "Eltávolítja az alkalmazást?",
"other": "Eltávolítja az alkalmazást?" "other": "Eltávolítja az alkalmazást?"

View File

@@ -239,7 +239,7 @@
"checkUpdateOnDetailPage": "Проверять наличие обновлений при открытии страницы представления приложения", "checkUpdateOnDetailPage": "Проверять наличие обновлений при открытии страницы представления приложения",
"disablePageTransitions": "Отключить анимацию перехода между страницами", "disablePageTransitions": "Отключить анимацию перехода между страницами",
"reversePageTransitions": "Реверс анимации перехода между страницами", "reversePageTransitions": "Реверс анимации перехода между страницами",
"minStarCount": "Minimum Star Count", "minStarCount": "Минимальное количество звёзд",
"removeAppQuestion": { "removeAppQuestion": {
"one": "Удалить приложение?", "one": "Удалить приложение?",
"other": "Удалить приложения?" "other": "Удалить приложения?"

View File

@@ -234,12 +234,12 @@
"requiresCredentialsInSettings": "此功能需要额外的凭据(在“设置”中添加)", "requiresCredentialsInSettings": "此功能需要额外的凭据(在“设置”中添加)",
"checkOnStart": "启动时进行一次检查", "checkOnStart": "启动时进行一次检查",
"tryInferAppIdFromCode": "尝试从源代码推断应用 ID", "tryInferAppIdFromCode": "尝试从源代码推断应用 ID",
"removeOnExternalUninstall": "Automatically remove externally uninstalled Apps", "removeOnExternalUninstall": "自动删除已卸载的外部应用",
"pickHighestVersionCode": "Auto-select highest version code APK", "pickHighestVersionCode": "自动选择版本号最高的 APK 文件",
"checkUpdateOnDetailPage": "Check for updates on opening an App detail page", "checkUpdateOnDetailPage": "打开应用详情页时检查更新",
"disablePageTransitions": "Disable page transition animations", "disablePageTransitions": "禁用页面过渡动画效果",
"reversePageTransitions": "Reverse page transition animations", "reversePageTransitions": "反转页面过渡动画效果",
"minStarCount": "Minimum Star Count", "minStarCount": "最小星标数",
"removeAppQuestion": { "removeAppQuestion": {
"one": "是否删除应用?", "one": "是否删除应用?",
"other": "是否删除应用?" "other": "是否删除应用?"

View File

@@ -21,7 +21,7 @@ import 'package:easy_localization/src/easy_localization_controller.dart';
// ignore: implementation_imports // ignore: implementation_imports
import 'package:easy_localization/src/localization.dart'; import 'package:easy_localization/src/localization.dart';
const String currentVersion = '0.13.19'; const String currentVersion = '0.13.21';
const String currentReleaseTag = const String currentReleaseTag =
'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES 'v$currentVersion-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES

View File

@@ -144,6 +144,24 @@ class AppsProvider with ChangeNotifier {
}(); }();
} }
Future<File> downloadFileWithRetry(
String url, String fileNameNoExt, Function? onProgress,
{bool useExisting = true,
Map<String, String>? headers,
int retries = 3}) async {
try {
return await downloadFile(url, fileNameNoExt, onProgress,
useExisting: useExisting, headers: headers);
} catch (e) {
if (retries > 0 && e is ClientException) {
return await downloadFileWithRetry(url, fileNameNoExt, onProgress,
useExisting: useExisting, headers: headers, retries: (retries - 1));
} else {
rethrow;
}
}
}
Future<File> downloadFile( Future<File> downloadFile(
String url, String fileNameNoExt, Function? onProgress, String url, String fileNameNoExt, Function? onProgress,
{bool useExisting = true, Map<String, String>? headers}) async { {bool useExisting = true, Map<String, String>? headers}) async {
@@ -236,8 +254,9 @@ class AppsProvider with ChangeNotifier {
notificationsProvider?.cancel(notif.id); notificationsProvider?.cancel(notif.id);
int? prevProg; int? prevProg;
var fileNameNoExt = '${app.id}-${downloadUrl.hashCode}'; var fileNameNoExt = '${app.id}-${downloadUrl.hashCode}';
var downloadedFile = await downloadFile(downloadUrl, fileNameNoExt, var downloadedFile = await downloadFileWithRetry(
headers: source.requestHeaders, (double? progress) { downloadUrl, fileNameNoExt, headers: source.requestHeaders,
(double? progress) {
int? prog = progress?.ceil(); int? prog = progress?.ceil();
if (apps[app.id] != null) { if (apps[app.id] != null) {
apps[app.id]!.downloadProgress = progress; apps[app.id]!.downloadProgress = progress;

View File

@@ -449,8 +449,11 @@ abstract class AppSource {
} }
ObtainiumError getObtainiumHttpError(Response res) { ObtainiumError getObtainiumHttpError(Response res) {
return ObtainiumError(res.reasonPhrase ?? return ObtainiumError((res.reasonPhrase != null &&
tr('errorWithHttpStatusCode', args: [res.statusCode.toString()])); res.reasonPhrase != null &&
res.reasonPhrase!.isNotEmpty)
? res.reasonPhrase!
: tr('errorWithHttpStatusCode', args: [res.statusCode.toString()]));
} }
abstract class MassAppUrlSource { abstract class MassAppUrlSource {

View File

@@ -222,10 +222,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: file_picker name: file_picker
sha256: b1729fc96627dd44012d0a901558177418818d6bd428df59dcfeb594e5f66432 sha256: "21145c9c268d54b1f771d8380c195d2d6f655e0567dc1ca2f9c134c02c819e0a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.3.2" version: "5.3.3"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter

View File

@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 0.13.19+183 # When changing this, update the tag in main() accordingly version: 0.13.21+185 # When changing this, update the tag in main() accordingly
environment: environment:
sdk: '>=2.18.2 <3.0.0' sdk: '>=2.18.2 <3.0.0'