mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-03 09:34:51 +02:00
Fix use of optionals
This commit is contained in:
parent
f40da562a6
commit
29f08a5e5d
1 changed files with 3 additions and 2 deletions
|
@ -28,10 +28,11 @@ public class AbsDownloader: CAPPlugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func startLibraryItemDownload(libraryItem: LibraryItem) {
|
||||
let length = libraryItem.media.tracks.count
|
||||
let length = libraryItem.media.tracks?.count ?? 0
|
||||
if length > 0 {
|
||||
libraryItem.media.tracks.enumerated().forEach { position, track in
|
||||
libraryItem.media.tracks?.enumerated().forEach { position, track in
|
||||
NSLog("TRACK \(track.contentUrl!)")
|
||||
// filename needs to be encoded otherwise would just use contentUrl
|
||||
let filename = track.metadata?.filename ?? ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue