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.21k stars 44 forks source link

Favorite flag is not propagated to file system (remote share) music provider #2448

Closed madbrain76 closed 2 weeks ago

madbrain76 commented 2 weeks ago

What version of Music Assistant has the issue?

2.0.4

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

2024.5.1

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

The problem

When favoriting a track in the file system provider, synchronizing, and reloading the provider, the favorite flag is lost

How to reproduce

  1. start with no music providers in MA
  2. add the file system provider (remote share)
  3. go the album view, and open an album
  4. favorite one track
  5. in MA settings, synchronize the music provider
  6. in MA settings, delete the music provider
  7. wait until the album and tracks disappear from thire respective views
  8. repeat steps 2 and 3
  9. observe that no tracks are favorited

Music Providers

file system (remote share)

Player Providers

N/A

Full log output

log.txt log.txt

Additional information

No response

What version of Home Assistant Core are your running

2024.6.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Windows

OzGav commented 2 weeks ago

Favourites apply to the library not the provider. So if you delete the item from the library which you did by deleting the provider then all info is lost. This is expected behaviour.

madbrain76 commented 2 weeks ago

I could have sworn this was not the case with the Qobuz provider. I believe the favorite flag change is sent to Qobuz when synchronizing the provider and restarting the Android app. That does not seem consistent with what happens with the file system provider. Since it has write access to the network shares, I expected favorite tags to be written to the Metadata in the files.

OzGav commented 2 weeks ago

MA does not change any metadata on the local files

madbrain76 commented 2 weeks ago

I see. That seems like a clear feature request then. Not sure if there is an existing one. Not everyone will want this so it should probably be a provider option .

marcelveldt commented 2 weeks ago

There is an action item to have this behavior configurabe for all providers on the backlog

OzGav commented 2 weeks ago

I am not aware of any “favourite” tag in the ID3 specification?

In MA a favourite is simply a way to create a subset of the Library items, a filter is another way to think of it.

Streaming providers have different terms for what some might call “favourites”. Spotify calls it “Your Library”, Tidal calls it “My Collection” etc. If you add an item to the MA library then that item will also be added to the providers favourites/library/collection (whatever they call it).

If you “favourite” an item in MA that is not in the MA library then it will be added to the MA library and therefore the streaming provider as described above. As Marcel said above the option to not do this sync between the MA library and the streaming provider is on the to do list

marcelveldt commented 2 weeks ago

The favorite flag (heart icon) in Music Assistant itself is just a way to prioritize your items in the MA library/database, see it as an additional filter. It has no impact on the actual provider but it is true that the streaming providers library content get imported with the favorite flag set to true by default (while filesystem items do not) - this is just some historical decision.

Imo the only proper way to handle it is to allow you per provider(instance) to configure if/how you want to import/export. This is the item on the backlog we should pickup:

https://github.com/orgs/music-assistant/projects/2/views/1?pane=issue&itemId=62335206

madbrain76 commented 2 weeks ago

@OzGav Oz @marcelveldt,

Thanks for the explanations. The backlog issue looks good. And I see that the github backlog does have proper tracking fields, unlike the ones merely under "issues". Not sure why I never saw this before.

I agree with you the sync should be clear, and it depends on what the specific provider supports, and also what the user wants. It is tricky for the UI when each provider is doing things differently.

I filed 2 related RFEs to that effect. I hope they get added to the backlog, and get addressed some day, as I believe UX would be improved. I wish I could contribute to it myself, but my skills are primarily in C/C++/assembler, which don't have any relevance to MA code.

Support for star ratings : https://github.com/orgs/music-assistant/discussions/2461

Persistence in the FS provider (s) : https://github.com/orgs/music-assistant/discussions/2463

OzGav commented 2 weeks ago

As the initial reported issue is expected behaviour and the related feature request is already on the backlog I am closing this.