Use AlbumArtist tag even for compilations, when it is specified.

If the tracks' AlbumArtists are different, then use "Various Artists"
This commit is contained in:
Deluan
2021-07-15 11:53:08 -04:00
parent 5064cb2a46
commit 8d56ec898e
4 changed files with 94 additions and 35 deletions
+1 -12
View File
@@ -152,7 +152,7 @@ func childFromMediaFile(ctx context.Context, mf model.MediaFile) responses.Child
if ok && player.ReportRealPath {
child.Path = mf.Path
} else {
child.Path = fmt.Sprintf("%s/%s/%s.%s", mapSlashToDash(realArtistName(mf)), mapSlashToDash(mf.Album), mapSlashToDash(mf.Title), mf.Suffix)
child.Path = fmt.Sprintf("%s/%s/%s.%s", mapSlashToDash(mf.AlbumArtist), mapSlashToDash(mf.Album), mapSlashToDash(mf.Title), mf.Suffix)
}
child.DiscNumber = mf.DiscNumber
child.Created = &mf.CreatedAt
@@ -174,17 +174,6 @@ func childFromMediaFile(ctx context.Context, mf model.MediaFile) responses.Child
return child
}
func realArtistName(mf model.MediaFile) string {
switch {
case mf.Compilation:
return consts.VariousArtists
case mf.AlbumArtist != "":
return mf.AlbumArtist
}
return mf.Artist
}
func mapSlashToDash(target string) string {
return strings.ReplaceAll(target, "/", "_")
}