Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playlists not syncing correctly from Jellyfin #3278

Open
1 task done
tanc opened this issue Dec 7, 2024 · 6 comments
Open
1 task done

Playlists not syncing correctly from Jellyfin #3278

tanc opened this issue Dec 7, 2024 · 6 comments
Assignees
Labels

Comments

@tanc
Copy link

tanc commented Dec 7, 2024

What version of Music Assistant has the issue?

2.4.0b7

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

2024.12.1

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

  • Yes

The problem

When syncing a Jellyfin music provider with playlists, those playlists don't proper sync.

How to reproduce

Set up Music Assistant with a Jellyfin server music provider. Test that albums are syncing and can be played to confirm there is no issue with communication.

  1. Create a playlist in Jellyfin 10.10.3 with some tracks
  2. Go to Music Assistant and sync the Jellyfin music provider
  3. Go to the Playlists tab of Music Assistant and note that the playlist appears but:
  4. With a title "Playlist" and no tracks
  5. Not at all
  6. With the correct title but no tracks

Music Providers

Jellyfin

Player Providers

Web UI

Full log output

music-assistant.log

Additional information

In the logs I can see Sync task for Jellyfin Media Server Library completed with errors

What version of Home Assistant Core are your running

2024.12.1

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Linux

@tanc tanc added the triage label Dec 7, 2024
@OzGav
Copy link
Contributor

OzGav commented Dec 7, 2024

As requested in the issue template paste the full log

@tanc
Copy link
Author

tanc commented Dec 7, 2024

Is that not the full log? When I'm back at my machine I'll hunt to see if there is a fuller log

@OzGav
Copy link
Contributor

OzGav commented Dec 7, 2024

Sorry somehow I didn't see it at first glance. If you can fix that Sonos player problem which is spamming your log then that will make it easier to read. Once that is fixed then turn on debug logging for the Jellyfin provider, restart MA and then once the log says the sync for Jellyfin is complete then post the log again.

@tanc
Copy link
Author

tanc commented Dec 7, 2024

No problem. I've disabled the sonos integration and then enabled debug log level for the Jellyfin provider. I then did another sync and this is the log, starting from the point of enabling the debug log level:
music-assistant (1).log

@Jc2k
Copy link

Jc2k commented Dec 7, 2024

Can you turn on debug logging for "music controller" as well and try again.

If there's an exception while syncing it's logged under the music controller, not the provider.

@tanc
Copy link
Author

tanc commented Dec 8, 2024

With music controller debug logging turned on the updated log looks like this (truncated):
music-assistant (2).log

The exception(s):

Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/aiojellyfin/session.py", line 69, in get_json
    resp = await self._session.get(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/aiohttp/client.py", line 827, in _request
    resp.raise_for_status()
  File "/app/venv/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1150, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://media.jampony.net/Users/5006413a420043e592f4b6dfb5e5e687/Items/9926862deffa9358d3bf529c82b37481?Fields=Path,Genres,SortName,Studios,Writer,Taglines,LocalTrailerCount,OfficialRating,CumulativeRunTimeTicks,ItemCounts,Metascore,AirTime,DateCreated,People,Overview,CriticRating,CriticRatingSummary,Etag,ShortOverview,ProductionLocations,Tags,ProviderIds,ParentId,RemoteTrailers,SpecialEpisodeNumbers,MediaSources,VoteCount,RecursiveItemCount,PrimaryImageAspectRatio'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/music.py", line 870, in run_sync
    async for _ in self.playlists.tracks(playlist.item_id, playlist.provider):
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/playlists.py", line 66, in tracks
    tracks = await self._get_provider_playlist_tracks(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/playlists.py", line 364, in _get_provider_playlist_tracks
    items = await provider.get_playlist_tracks(item_id, page=page)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/providers/jellyfin/__init__.py", line 398, in get_playlist_tracks
    jellyfin_playlist = await self._client.get_playlist(prov_playlist_id)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/aiojellyfin/__init__.py", line 129, in get_playlist
    await self._session.get_json(
  File "/app/venv/lib/python3.12/site-packages/aiojellyfin/session.py", line 82, in get_json
    raise NotFound("Resource not found")
aiojellyfin.session.NotFound: Resource not found

Could this be a playlist referring to a track item that doesn't exist that then causes a 404 error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants