mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
We don't need strong references here
This commit is contained in:
parent
51e2e65098
commit
e3d71284cc
@ -46,15 +46,15 @@ class AlbumDetailView: NSViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getAlbumSongs(for album: Album) {
|
func getAlbumSongs(for album: Album) {
|
||||||
App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { (mpdSongs: [MPDClient.MPDSong]) in
|
App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { [weak self] (mpdSongs: [MPDClient.MPDSong]) in
|
||||||
self.dataSource.setAlbumSongs(
|
self?.dataSource.setAlbumSongs(
|
||||||
mpdSongs.map { Song(mpdSong: $0) }
|
mpdSongs.map { Song(mpdSong: $0) }
|
||||||
)
|
)
|
||||||
|
|
||||||
self.getBigCoverArt(song: self.dataSource.albumSongs.first!.song ?? self.dataSource.albumSongs[1].song!)
|
//self?.getBigCoverArt(song: self?.dataSource.albumSongs.first!.song ?? self?.dataSource.albumSongs[1].song!)
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.albumTracksView.reloadData()
|
self?.albumTracksView.reloadData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,10 +63,10 @@ class AlbumDetailView: NSViewController {
|
|||||||
let coverArtService = CoverArtService(song: song)
|
let coverArtService = CoverArtService(song: song)
|
||||||
|
|
||||||
coverArtService.fetchBigCoverArt()
|
coverArtService.fetchBigCoverArt()
|
||||||
.done() { image in
|
.done() { [weak self] image in
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
if let image = image {
|
if let image = image {
|
||||||
self.albumCoverView.image = image
|
self?.albumCoverView.image = image
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user