mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-20 09:40:17 +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) {
|
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 ?? ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue