Starting logic for handling completed downloads

This commit is contained in:
ronaldheft
2022-08-06 21:32:04 -04:00
parent 7fded5e105
commit 5495bcb945
2 changed files with 29 additions and 1 deletions
+8
View File
@@ -46,6 +46,14 @@ extension DownloadItem {
self.itemTitle = libraryItem.media.metadata.title
self.media = libraryItem.media
}
func isDoneDownloading() -> Bool {
self.downloadItemParts.allSatisfy({ $0.completed })
}
func didDownloadSuccessfully() -> Bool {
self.downloadItemParts.allSatisfy({ $0.failed = false })
}
}
struct DownloadItemPart: Realmable, Codable {