Skip to content

Commit

Permalink
Some songs don't have an AlbumArtist listed
Browse files Browse the repository at this point in the history
  • Loading branch information
danbee committed Apr 1, 2019
1 parent fc99c59 commit 5a8bc4a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Persephone/MPDClient/Models/MPDSong.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,18 @@ extension MPDClient {
var album: MPDAlbum {
return MPDAlbum(
title: getTag(.album),
artist: getTag(.albumArtist)
artist: artist
)
}

var artist: String {
if getTag(.albumArtist) != "" {
return getTag(.albumArtist)
} else {
return getTag(.artist)
}
}

func getTag(_ tagType: TagType) -> String {
let mpdTagType = mpd_tag_type(rawValue: Int32(tagType.rawValue))

Expand Down

0 comments on commit 5a8bc4a

Please sign in to comment.