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:
parent
44b5c147c7
commit
4606745f2c
@ -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 -> {}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user