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

Render track artist when they don't match album artist

This commit is contained in:
Wim Looman 2020-06-18 12:05:03 +02:00 committed by Daniel Barber
parent c7ea8f34d0
commit 32a4e38bd1
3 changed files with 20 additions and 8 deletions

View File

@ -83,7 +83,14 @@ extension AlbumDetailView: NSTableViewDelegate {
owner: self owner: self
) as! NSTableCellView ) as! NSTableCellView
cellView.textField?.stringValue = song.title if song.artist != song.album.artist {
let string = NSMutableAttributedString()
string.append(NSAttributedString(string: song.title))
string.append(NSAttributedString(string: " " + song.artist, attributes: [.foregroundColor: NSColor.secondaryLabelColor]))
cellView.textField?.attributedStringValue = string
} else {
cellView.textField?.stringValue = song.title
}
return cellView return cellView
} }

View File

@ -73,7 +73,7 @@ extension MPDClient {
let mpdAlbum = MPDAlbum( let mpdAlbum = MPDAlbum(
title: mpdSong.album.title, title: mpdSong.album.title,
artist: mpdSong.artist, artist: mpdSong.album.artist,
firstSong: mpdSong, firstSong: mpdSong,
date: mpdSong.date date: mpdSong.date
) )

View File

@ -36,17 +36,22 @@ extension MPDClient {
var album: MPDAlbum { var album: MPDAlbum {
return MPDAlbum( return MPDAlbum(
title: getTag(.album), title: getTag(.album),
artist: artist, artist: albumArtist,
date: date date: date
) )
} }
var artist: String { var artist: String {
if getTag(.albumArtist) != "" { return getTag(.artist)
return getTag(.albumArtist) }
} else {
return getTag(.artist) var albumArtist: String {
} let albumArtist = getTag(.albumArtist);
if albumArtist != "" {
return albumArtist
} else {
return artist
}
} }
var date: String { var date: String {