mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 10:35:42 +02:00
Report download progress to the UI
This commit is contained in:
parent
d5d65e244b
commit
af2c609405
3 changed files with 47 additions and 7 deletions
|
@ -28,6 +28,10 @@ struct DownloadItem: Realmable, Codable {
|
|||
static func indexedProperties() -> [String] {
|
||||
["libraryItemId"]
|
||||
}
|
||||
|
||||
private enum CodingKeys : String, CodingKey {
|
||||
case id, libraryItemId, episodeId, userMediaProgress, serverConnectionConfigId, serverAddress, serverUserId, mediaType, itemTitle, downloadItemParts
|
||||
}
|
||||
}
|
||||
|
||||
extension DownloadItem {
|
||||
|
@ -58,17 +62,20 @@ struct DownloadItemPart: Realmable, Codable {
|
|||
var uri: String?
|
||||
var destinationUri: String?
|
||||
var finalDestinationUri: String?
|
||||
var downloadId: Int?
|
||||
var progress: Int = 0
|
||||
var progress: Double = 0
|
||||
var task: URLSessionDownloadTask!
|
||||
|
||||
private enum CodingKeys : String, CodingKey {
|
||||
case id, progress
|
||||
static func primaryKey() -> String? {
|
||||
return "id"
|
||||
}
|
||||
|
||||
static func ignoredProperties() -> [String] {
|
||||
["task"]
|
||||
}
|
||||
|
||||
private enum CodingKeys : String, CodingKey {
|
||||
case id, filename, completed, moved, failed, progress
|
||||
}
|
||||
}
|
||||
|
||||
extension DownloadItemPart {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue