Somewhat working progress under heavy load

This commit is contained in:
ronaldheft
2022-08-07 21:02:25 -04:00
parent ad802c16ea
commit b1b10e846d
2 changed files with 42 additions and 16 deletions
+2 -2
View File
@@ -120,7 +120,7 @@ class Database {
public func saveLocalLibraryItem(localLibraryItem: LocalLibraryItem) {
let realm = try! Realm()
try! realm.write { realm.add(localLibraryItem) }
try! realm.write { realm.add(localLibraryItem, update: .modified) }
}
public func getDownloadItem(downloadItemId: String) -> DownloadItem? {
@@ -140,7 +140,7 @@ class Database {
public func saveDownloadItem(_ downloadItem: DownloadItem) {
let realm = try! Realm()
return try! realm.write { realm.add(downloadItem) }
return try! realm.write { realm.add(downloadItem, update: .modified) }
}
public func updateDownloadItemPart(_ part: DownloadItemPart) {