cleanup leaked downloaded file

This commit is contained in:
2026-06-23 20:14:07 +03:00
parent 11f0db9c0a
commit 0452b17791
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ android {
applicationId = namespace
minSdk = libs.versions.proj.min.get().toInt()
targetSdk = libs.versions.proj.target.get().toInt()
versionCode = 37
versionName = "1.19.1"
versionCode = 38
versionName = "1.20"
}
}
@@ -48,7 +48,10 @@ class AndroidOfflineStorage(
combine(
items.map { item ->
downloader.query(item.download_id)
.mapNotNull { state -> item.toDomain(state) }
.mapNotNull { state ->
if (state == null) remove(item.id)
item.toDomain(state)
}
}
) { it.toList() }
}.flowOn(Dispatchers.IO)