From e3d71284ccd5dd9d3a6e69163a3d8d8ec6df5506 Mon Sep 17 00:00:00 2001 From: Daniel Barber Date: Sun, 2 Jun 2019 22:36:52 -0400 Subject: [PATCH] We don't need strong references here --- Persephone/Controllers/AlbumDetailView.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Persephone/Controllers/AlbumDetailView.swift b/Persephone/Controllers/AlbumDetailView.swift index a4639cd..0fef285 100644 --- a/Persephone/Controllers/AlbumDetailView.swift +++ b/Persephone/Controllers/AlbumDetailView.swift @@ -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 } } }