mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 10:35:42 +02:00
Support downloading covers and podcast episodes
This commit is contained in:
parent
b549528e23
commit
5b7fcca800
2 changed files with 71 additions and 15 deletions
|
@ -35,10 +35,9 @@ struct DownloadItem: Realmable, Codable {
|
|||
}
|
||||
|
||||
extension DownloadItem {
|
||||
init(libraryItem: LibraryItem, server: ServerConnectionConfig) {
|
||||
init(libraryItem: LibraryItem, episodeId: String?, server: ServerConnectionConfig) {
|
||||
self.id = libraryItem.id
|
||||
self.libraryItemId = libraryItem.id
|
||||
//self.episodeId // TODO
|
||||
self.userMediaProgress = libraryItem.userMediaProgress
|
||||
self.serverConnectionConfigId = server.id
|
||||
self.serverAddress = server.address
|
||||
|
@ -46,6 +45,11 @@ extension DownloadItem {
|
|||
self.mediaType = libraryItem.mediaType
|
||||
self.itemTitle = libraryItem.media.metadata.title
|
||||
self.media = libraryItem.media
|
||||
|
||||
if let episodeId = episodeId {
|
||||
self.id! += "-\(episodeId)"
|
||||
self.episodeId = episodeId
|
||||
}
|
||||
}
|
||||
|
||||
func isDoneDownloading() -> Bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue