mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-26 19:23:45 +01:00 
			
		
		
		
	Better download file naming (reduces conflicts)
This commit is contained in:
		| @@ -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.11.26'; | const String currentVersion = '0.11.27'; | ||||||
| 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 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -165,11 +165,10 @@ class AppsProvider with ChangeNotifier { | |||||||
|       notifyListeners(); |       notifyListeners(); | ||||||
|     } |     } | ||||||
|     try { |     try { | ||||||
|       var fileName = |  | ||||||
|           '${app.id}-${app.latestVersion}-${app.preferredApkIndex}.apk'; |  | ||||||
|       String downloadUrl = await SourceProvider() |       String downloadUrl = await SourceProvider() | ||||||
|           .getSource(app.url) |           .getSource(app.url) | ||||||
|           .apkUrlPrefetchModifier(app.apkUrls[app.preferredApkIndex].value); |           .apkUrlPrefetchModifier(app.apkUrls[app.preferredApkIndex].value); | ||||||
|  |       var fileName = '${app.id}-${downloadUrl.hashCode}.apk'; | ||||||
|       var notif = DownloadNotification(app.name, 100); |       var notif = DownloadNotification(app.name, 100); | ||||||
|       notificationsProvider?.cancel(notif.id); |       notificationsProvider?.cancel(notif.id); | ||||||
|       int? prevProg; |       int? prevProg; | ||||||
| @@ -205,7 +204,7 @@ class AppsProvider with ChangeNotifier { | |||||||
|         var originalAppId = app.id; |         var originalAppId = app.id; | ||||||
|         app.id = newInfo.packageName; |         app.id = newInfo.packageName; | ||||||
|         downloadedFile = downloadedFile.renameSync( |         downloadedFile = downloadedFile.renameSync( | ||||||
|             '${downloadedFile.parent.path}/${app.id}-${app.latestVersion}-${app.preferredApkIndex}.apk'); |             '${downloadedFile.parent.path}/${app.id}-${downloadUrl.hashCode}.apk'); | ||||||
|         if (apps[originalAppId] != null) { |         if (apps[originalAppId] != null) { | ||||||
|           await removeApps([originalAppId]); |           await removeApps([originalAppId]); | ||||||
|           await saveApps([app]); |           await saveApps([app]); | ||||||
|   | |||||||
| @@ -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.11.26+148 # When changing this, update the tag in main() accordingly | version: 0.11.27+149 # 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' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user