mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-28 06:14:00 +02:00
Fix use of optionals
This commit is contained in:
@@ -28,10 +28,11 @@ public class AbsDownloader: CAPPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func startLibraryItemDownload(libraryItem: LibraryItem) {
|
func startLibraryItemDownload(libraryItem: LibraryItem) {
|
||||||
let length = libraryItem.media.tracks.count
|
let length = libraryItem.media.tracks?.count ?? 0
|
||||||
if length > 0 {
|
if length > 0 {
|
||||||
libraryItem.media.tracks.enumerated().forEach { position, track in
|
libraryItem.media.tracks?.enumerated().forEach { position, track in
|
||||||
NSLog("TRACK \(track.contentUrl!)")
|
NSLog("TRACK \(track.contentUrl!)")
|
||||||
// filename needs to be encoded otherwise would just use contentUrl
|
// filename needs to be encoded otherwise would just use contentUrl
|
||||||
let filename = track.metadata?.filename ?? ""
|
let filename = track.metadata?.filename ?? ""
|
||||||
|
|||||||
Reference in New Issue
Block a user