mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-18 16:18:52 +01:00
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:
parent
5064cb2a46
commit
8d56ec898e
4 changed files with 94 additions and 35 deletions
|
|
@ -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, "/", "_")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue