music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.2k stars 44 forks source link

Track on multiple albums not appearing on all #2506

Closed MelHarbour closed 1 week ago

MelHarbour commented 1 week ago

What version of Music Assistant has the issue?

2.1.0b6

What version of the Home Assistant Integration have you got installed?

2024.6.2

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

I have two compilation albums. The same track is on both albums. They are loaded via the remote filesystem provider. The track only appears on one of the two albums.

How to reproduce

Clean install with two albums featuring the same track. Observe track listing in the album details view for each. Notice missing track.

Music Providers

Remote file provider

Player Providers

N/A

Full log output

log.log

Additional information

No response

What version of Home Assistant Core are your running

2024.6.3

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

MelHarbour commented 1 week ago

For reference, note missing track here: image

And the tagging in Picard: image

MelHarbour commented 1 week ago

Looking at the info page for the track it only lists as appearing on one album: image

I assume the intended behaviour is that it would show that it appears on two different albums. I assume therefore that the relevant album_track record is not being added during import.

MelHarbour commented 1 week ago

And the answer is the code explicitly causes it to overwrite for the local filesystem provider (and subclasses):

https://github.com/music-assistant/server/blob/642ccbef85bd5a190078563e8572a5aa0dbc0e89/music_assistant/server/controllers/media/tracks.py#L415

https://github.com/music-assistant/server/blob/642ccbef85bd5a190078563e8572a5aa0dbc0e89/music_assistant/server/providers/filesystem_local/base.py#L374

@marcelveldt Any thoughts on how to make the overwrite a little more careful in what it does?

marcelveldt commented 1 week ago

Ah this edge case.... Problem is when someone intentionally changed the ID3 tags. So they index their files with very bad ID3 tags and then fix them. I guess we just need to better handle that usecase and/or require some additional action.

I'll chew on it a bit - I have an idea.

MelHarbour commented 1 week ago

While sorting children's breakfast, a thought:

Perhaps overwrite should force overwrite of the data for a track, but should ignore the album_tracks table?

MelHarbour commented 1 week ago

It's probably a minor point as well, but the behaviour of linking the two tracks does mean that technically it will show the listing from one disc wrongly if, like in this case, the title differs between the two listings. I feel like that's a secondary problem though.