diff --git a/Persephone/Components/Browser/Album Detail/AlbumDetailView.swift b/Persephone/Components/Browser/Album Detail/AlbumDetailView.swift index 1668a10..0f0224c 100644 --- a/Persephone/Components/Browser/Album Detail/AlbumDetailView.swift +++ b/Persephone/Components/Browser/Album Detail/AlbumDetailView.swift @@ -123,12 +123,10 @@ class AlbumDetailView: NSViewController { self.albumTracksView.reloadData() - guard !self.dataSource.albumSongs.isEmpty, - let song = self.dataSource.albumSongs.first?.song ?? - self.dataSource.albumSongs[1].song + guard let mpdSong = album.mpdAlbum.firstSong else { return } - self.getBigCoverArt(song: song, album: album) + self.getBigCoverArt(song: Song(mpdSong: mpdSong), album: album) } } } diff --git a/Persephone/Components/Shared/ImageDataProviders/MPDAlbumArtImageDataProvider.swift b/Persephone/Components/Shared/ImageDataProviders/MPDAlbumArtImageDataProvider.swift index a0b6f38..09c6ed0 100644 --- a/Persephone/Components/Shared/ImageDataProviders/MPDAlbumArtImageDataProvider.swift +++ b/Persephone/Components/Shared/ImageDataProviders/MPDAlbumArtImageDataProvider.swift @@ -12,9 +12,9 @@ import Kingfisher public struct MPDAlbumArtImageDataProvider: ImageDataProvider { let songUri: String - init(songUri: String, cacheKey: String? = nil) { + init(songUri: String, cacheKey: String) { self.songUri = songUri - self.cacheKey = cacheKey ?? songUri + self.cacheKey = cacheKey } public var cacheKey: String diff --git a/Persephone/MPDClient/Extensions/MPDClient+Songs.swift b/Persephone/MPDClient/Extensions/MPDClient+Songs.swift index b7986f0..0cdccef 100644 --- a/Persephone/MPDClient/Extensions/MPDClient+Songs.swift +++ b/Persephone/MPDClient/Extensions/MPDClient+Songs.swift @@ -74,17 +74,15 @@ extension MPDClient { let newOffset = offset + Int32(chunkSize) - if newOffset < size! { - DispatchQueue.main.async { + DispatchQueue.main.async { + if newOffset < size! { self.fetchAlbumArt( songUri: songUri, imageData: data, offset: newOffset, callback: callback ) - } - } else { - DispatchQueue.main.async { + } else { callback(data) } }