mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-12-06 23:06:33 +01:00
Fix the downloader for using Realm native
This commit is contained in:
1 parent
4c8217edf6
commit
5d31499fd6
3 files changed
+67
-42
No files matched your search
@@ -73,7 +73,6 @@ class DownloadItemPart: Object, Codable {
|
||||
@Persisted var uri: String?
|
||||
@Persisted var destinationUri: String?
|
||||
@Persisted var progress: Double = 0
|
||||
var task: URLSessionDownloadTask?
|
||||
|
||||
private enum CodingKeys : String, CodingKey {
|
||||
case id, filename, itemTitle, completed, moved, failed, progress
|
||||
|
||||
@@ -164,11 +164,6 @@ class Database {
|
||||
return try! realm.write { realm.add(downloadItem, update: .modified) }
|
||||
}
|
||||
|
||||
public func updateDownloadItemPart(_ part: DownloadItemPart) {
|
||||
let realm = try! Realm()
|
||||
return try! realm.write { realm.add(part, update: .modified) }
|
||||
}
|
||||
|
||||
public func removeDownloadItem(_ downloadItem: DownloadItem) {
|
||||
let realm = try! Realm()
|
||||
return try! realm.write { realm.delete(downloadItem) }
|
||||
|
||||
Reference in new issue
Block a user