mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-07-29 16:08:38 +02:00
Clean up progress logic
This commit is contained in:
@@ -169,15 +169,9 @@ class Database {
|
||||
}
|
||||
}
|
||||
|
||||
public func updateDownloadItemPartPercent(downloadItemPartId: String, percent: Double) {
|
||||
public func updateDownloadItemPart(_ part: DownloadItemPart) {
|
||||
Database.realmQueue.sync {
|
||||
try! instance.write {
|
||||
let part = instance.object(ofType: DownloadItemPart.self, forPrimaryKey: downloadItemPartId)
|
||||
guard var part = part else {
|
||||
NSLog("downloadItemPartId not found (\(downloadItemPartId)")
|
||||
return
|
||||
}
|
||||
part.progress = percent
|
||||
instance.add(part, update: .modified)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user