1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Compare commits

..

No commits in common. "1073dbd94c702b22b075a51159fc330b990e524f" and "6acc14926b1d34b50e197fbbd029c662bffa1f8c" have entirely different histories.

4 changed files with 22 additions and 15 deletions

View File

@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift", "repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift",
"state": { "state": {
"branch": null, "branch": null,
"revision": "a44caef0550c346e0ab9172f7c9a3852c1833599", "revision": "3a2acbb32ab68215ee1596ee6004da8e90c3721b",
"version": "1.3.0" "version": "1.0.0"
} }
}, },
{ {
@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/tonyarnold/Differ", "repositoryURL": "https://github.com/tonyarnold/Differ",
"state": { "state": {
"branch": null, "branch": null,
"revision": "dd5d4bfb1c27012d4790e877b29847d2ab9d989b", "revision": "e2cca36e7258dd8add88ae46b5ea56509b066e21",
"version": "1.4.4" "version": "1.4.3"
} }
}, },
{ {
@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/PromiseKit/Foundation", "repositoryURL": "https://github.com/PromiseKit/Foundation",
"state": { "state": {
"branch": null, "branch": null,
"revision": "1a276e598dac59489ed904887e0740fa75e571e0", "revision": "ee06d95342a5007de2fffd898f4f35de026842ac",
"version": "3.3.4" "version": "3.3.3"
} }
}, },
{ {
@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/onevcat/Kingfisher.git", "repositoryURL": "https://github.com/onevcat/Kingfisher.git",
"state": { "state": {
"branch": null, "branch": null,
"revision": "44bfa76787a0f07e4d5ae3304e9d4f631fd519bd", "revision": "8ef6ca8b1b767ac2400762ed2f2bf75ddea3de5b",
"version": "5.13.0" "version": "5.10.1"
} }
}, },
{ {
@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/mxcl/PromiseKit", "repositoryURL": "https://github.com/mxcl/PromiseKit",
"state": { "state": {
"branch": null, "branch": null,
"revision": "f14f16cc2602afec1030e4f492100d6d43dca544", "revision": "4d8d1287d2e50c53a9f8430ffe88925292838c57",
"version": "6.13.1" "version": "6.11.0"
} }
}, },
{ {

View File

@ -113,7 +113,9 @@ class AlbumDetailView: NSViewController {
} }
func getAlbumSongs(for album: Album) { func getAlbumSongs(for album: Album) {
App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { [self] (mpdSongs: [MPDClient.MPDSong]) in App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { [weak self] (mpdSongs: [MPDClient.MPDSong]) in
guard let self = self else { return }
self.dataSource.setAlbumSongs( self.dataSource.setAlbumSongs(
mpdSongs.map { Song(mpdSong: $0) } mpdSongs.map { Song(mpdSong: $0) }
) )
@ -147,10 +149,15 @@ class AlbumDetailView: NSViewController {
] ]
) )
cacheSmallCover(provider: provider) cacheSmallCover(song: song, album: album)
} }
func cacheSmallCover(provider: MPDAlbumArtImageDataProvider) { func cacheSmallCover(song: Song, album: Album) {
let provider = MPDAlbumArtImageDataProvider(
songUri: song.mpdSong.uriString,
cacheKey: album.hash
)
_ = KingfisherManager.shared.retrieveImage( _ = KingfisherManager.shared.retrieveImage(
with: .provider(provider), with: .provider(provider),
options: [ options: [

View File

@ -127,7 +127,7 @@ extension MPDClient {
let callback = userData["callback"] as? (Data?) -> Void let callback = userData["callback"] as? (Data?) -> Void
else { return } else { return }
let imageData = userData["imageData"] as? Data? ?? nil var imageData = userData["imageData"] as? Data? ?? nil
sendFetchAlbumArt( sendFetchAlbumArt(
forUri: songUri, forUri: songUri,

View File

@ -67,7 +67,7 @@ extension MPDClient {
mpd_return_pair(self.connection, binaryPair.pair) mpd_return_pair(self.connection, binaryPair.pair)
_ = data[offset...].withUnsafeMutableBytes { (pointer) in _ = data[offset...].withUnsafeMutableBytes { (pointer) in
mpd_recv_binary(self.connection, pointer.baseAddress, chunkSize) mpd_recv_binary(self.connection, pointer, chunkSize)
} }
guard mpd_response_finish(self.connection) else { return } guard mpd_response_finish(self.connection) else { return }