mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-11-13 12:23:47 +01:00
Add try/catch around android cleanupExpired downloads call
This commit is contained in:
1 parent
989cf66715
commit
ed356a8d99
1 file changed
+7
@@ -44,6 +44,7 @@ object DownloadServiceHost {
|
||||
DbManager.initialize(appContext)
|
||||
manager = DownloadItemManager(FolderScanner(appContext), appContext, ForwardingEmitter)
|
||||
restoreJob = scope.launch {
|
||||
try {
|
||||
if (DeviceManager.dbManager.ensureValidDownloadQueue()) {
|
||||
IncompleteDownloadCleanup.cleanupExpired(appContext)
|
||||
manager!!.restoreQueue()
|
||||
@@ -51,6 +52,12 @@ object DownloadServiceHost {
|
||||
AbsLogger.error(TAG, "Skipping invalid download queue because it could not be cleared")
|
||||
}
|
||||
onRestoreComplete(appContext)
|
||||
} catch (restoreError: Exception) {
|
||||
AbsLogger.error(
|
||||
TAG,
|
||||
"Could not restore download queue (${restoreError.javaClass.simpleName}: ${restoreError.message})"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
return manager!!
|
||||
|
||||
Reference in new issue
Block a user