From 0f10543566997bfe5456750d2e27a17ca82deade Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 26 Feb 2022 01:10:27 -0800 Subject: [PATCH] Improve spam formatting string in two ways For one thing, improve it so that if the tracknumber field is present, but zero, it doesn't show the number sign in the spam. For the second, only show the track artist field if it differs from the album artist. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistEntry.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index b7c49512b..158d459d5 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -198,8 +198,9 @@ BOOL hasBitrate = (self.bitrate != 0); BOOL hasArtist = (self.artist != nil) && (![self.artist isEqualToString:@""]); BOOL hasAlbumArtist = (self.albumartist != nil) && (![self.albumartist isEqualToString:@""]); + BOOL hasTrackArtist = (hasArtist && hasAlbumArtist) && (![self.albumartist isEqualToString:self.artist]); BOOL hasAlbum = (self.album != nil) && (![self.album isEqualToString:@""]); - BOOL hasTrack = (self.track != 0); + BOOL hasTrack = (self.track != 0) && ([self.track intValue] != 0); BOOL hasLength = (self.totalFrames != 0); BOOL hasCurrentPosition = (self.currentPosition != 0) && (self.current); BOOL hasExtension = NO; @@ -262,7 +263,7 @@ [elements addObject:filename]; } - if(hasAlbumArtist && hasArtist) { + if(hasTrackArtist) { [elements addObject:@" // "]; [elements addObject:self.artist]; }