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:
@@ -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, "/", "_")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user