1
1
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:
Daniel Barber 2019-06-02 22:36:52 -04:00
parent 2bac18187c
commit 0ee299a9c8
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -46,15 +46,15 @@ class AlbumDetailView: NSViewController {
}
func getAlbumSongs(for album: Album) {
App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { (mpdSongs: [MPDClient.MPDSong]) in
self.dataSource.setAlbumSongs(
App.mpdClient.getAlbumSongs(for: album.mpdAlbum) { [weak self] (mpdSongs: [MPDClient.MPDSong]) in
self?.dataSource.setAlbumSongs(
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 {
self.albumTracksView.reloadData()
self?.albumTracksView.reloadData()
}
}
}
@ -63,10 +63,10 @@ class AlbumDetailView: NSViewController {
let coverArtService = CoverArtService(song: song)
coverArtService.fetchBigCoverArt()
.done() { image in
.done() { [weak self] image in
DispatchQueue.main.async {
if let image = image {
self.albumCoverView.image = image
self?.albumCoverView.image = image
}
}
}