mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-24 20:54:43 +02:00
Use book/podcast helper
This commit is contained in:
parent
5f4ff38035
commit
2b07c81e54
2 changed files with 3 additions and 2 deletions
|
@ -34,13 +34,13 @@ extension LocalLibraryItem {
|
|||
var fromMedia = fromMedia
|
||||
let fileMap = files.map { ($0.filename ?? "", $0.id) }
|
||||
let fileIdByFilename = Dictionary(fileMap, uniquingKeysWith: { (_, last) in last })
|
||||
if ( self.mediaType == "book" ) {
|
||||
if ( self.isBook ) {
|
||||
if let tracks = fromMedia.tracks {
|
||||
for i in tracks.indices {
|
||||
_ = fromMedia.tracks?[i].setLocalInfo(filenameIdMap: fileIdByFilename, serverIndex: i)
|
||||
}
|
||||
}
|
||||
} else if ( self.mediaType == "podcast" ) {
|
||||
} else if ( self.isPodcast ) {
|
||||
if let episodes = fromMedia.episodes {
|
||||
fromMedia.episodes = episodes.compactMap { episode in
|
||||
// Filter out episodes not downloaded
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue