0
0
mirror of https://github.com/mediathekview/zapp.git synced 2024-09-19 20:02:17 +02:00

Fix crash when restarting Zapp after removing a sd card with download files

This commit is contained in:
Christine Coenen 2023-10-26 15:25:38 +02:00
parent 44b5c147c7
commit 4606745f2c
2 changed files with 11 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import java.io.File
import java.io.FileNotFoundException
import java.io.FileOutputStream
import java.io.OutputStream
import java.util.*
import java.util.UUID
class DownloadFileInfoManager(
private val applicationContext: Context,
@ -80,12 +80,20 @@ class DownloadFileInfoManager(
resolver.delete(filePathUri, null, null)
} catch (e: SecurityException) {
// maybe file is already deleted - that's okay
} catch (e: IllegalArgumentException) {
// most likely the external volume has been removed -
// its not worth raising this error
Timber.e(e)
}
DownloadStatus.COMPLETED -> {
val videoContentValues = ContentValues()
videoContentValues.put(MediaStore.Video.Media.IS_PENDING, 0)
resolver.update(filePathUri, videoContentValues, null, null)
try {
resolver.update(filePathUri, videoContentValues, null, null)
} catch (e: SecurityException) {
// maybe file is already deleted - that's okay - db entry will adapt
}
}
else -> {}

View File

@ -1,5 +1,6 @@
# v-next
* Von Exoplayer auf neue Media-3-Bibliothek umgestiegen
* Absturz beim Starten von Zapp behoben, wenn vorher eine SD-Karte mit Downloads entfernt wurde
* Zapp auf Android 14 vorbereitet
# 8.3.2