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.4k stars 51 forks source link

Add to playlist dialog limited to 500 playlists #3206

Open thordy opened 5 days ago

thordy commented 5 days ago

What version of Music Assistant has the issue?

2.3.2

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

2024.11.4

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

The problem

Discord Discussion with Traveling_Gav about the issue here

When trying to add a track to a playlist from the MA Frontend, it opens the dialog of playlists, but it only shows a subset of my playlists + options to add new playlist to MA or Spotify. A lot of my playlists from Spotify are prefixed with - and <space> making names like

- rock
- top40
- chill
- rap

All the playlists which follow this format are shown correctly, but no other playlist is shown from any music providers. Adding a new playlist in Spotify with this prefix makes it show up, and same if I create a MA playlist with this prefix it show up, but all other playlists do not show up

How to reproduce

Create playlist named like - <something> and then try to add a track to a playlist in the frontend, and see what is being shown

  1. Search for Track
  2. Click on ...
  3. Click Add to Playlist...

Then only a subset of playlists are shown

Music Providers

Spotify Filesystem (Remote)

Player Providers

N/A

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.11.1

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Linux

thordy commented 5 days ago

So I did some more digging into this, and think I found where the issue might be. In AddToPlaylistDialog.vue where it executes getLibraryPlaylists, this for me, returns a array of exactly 500 elements. But I have a lot more than 500 playlists (closer to 1000, because each album on disk has a playlist).

Most of those playlists on disk show up in MA as editable: false, which make sense, and that's why they are not shown in the frontend. I tested by simply removing all the playlists on disk, and now everything works as expected in the frontend, and it shows my playlists like I expect.

Not sure if there is some limit from the API making it return only 500 elements, or if some bug happens here?

marcelveldt commented 4 days ago

More than 500 playlists is really an exception - that whole dialog is not even suitable for that. Of course we can fix it but it will be lo(er) prio for now. Until then best to exclude those album-only playlists from the fileprovider.