Merge pull request #2997 from Bnyro/master

Fix that thumbnails persist after deleting a download
This commit is contained in:
Bnyro 2023-02-08 09:59:10 +01:00 committed by GitHub
commit caa53270c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,10 +95,13 @@ class DownloadsAdapter(
.setMessage(R.string.irreversible) .setMessage(R.string.irreversible)
.setPositiveButton(R.string.okay) { _, _ -> .setPositiveButton(R.string.okay) { _, _ ->
items.map { File(it.path) }.forEach { file -> items.map { File(it.path) }.forEach { file ->
if (file.exists()) { runCatching {
try { if (file.exists()) file.delete()
file.delete() }
} catch (_: Exception) { } }
runCatching {
download.thumbnailPath?.let {
File(it).delete()
} }
} }