mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
Address some PR feedback
This commit is contained in:
parent
a7e7620f68
commit
fa338ee790
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user