hass-music-assistant icon indicating copy to clipboard operation
hass-music-assistant copied to clipboard

Plex Playlists not Syncing when Updated

Open bj61251 opened this issue 11 months ago • 5 comments

I'm having an issue with Playlists not syncing from Plex. I've been able to manually choose "Add to Library" via the Browse section for brand new playlists that don't appear right away, but if I simply modify a playlist in Plex (or for 'smart' playlists that auto update based on filter criteria), I can't seem to do anything to get it to update in Music Assistant (even the Browse > Plex Media Server Library > Playlists version). I've tried removing/re-adding, syncing Plex, restarting the server container, renaming the playlist, etc... The only thing that appears to work is to create a completely separate duplicate of the playlist with a new name, which mostly defeats the purpose. Is there any way to actually force the playlist to re-sync with Plex server?

Originally posted by @bj61251 in https://github.com/music-assistant/hass-music-assistant/discussions/1168#discussioncomment-6948810

bj61251 avatar Sep 09 '23 14:09 bj61251

Please browse to the playlist and then check the logs for any errors.

OzGav avatar Sep 09 '23 21:09 OzGav

I don't see any errors that seem to show up when I browse to the playlist (either under Playlists, or via Browse folders)

bj61251 avatar Sep 12 '23 14:09 bj61251

Unfortunately the Plex provider is not currently maintained. It will take some time to address this issue. At the moment we recommend you share your music directly with MA and take out the Plex middle man

OzGav avatar Nov 09 '23 12:11 OzGav

Beta 83 requires you to remove and reinstall the Plex provider. Remember to give MA some time to clean up the db. Do NOT restart MA or the host until that is completed. Let us know if this issue is then fixed.

OzGav avatar Jan 21 '24 02:01 OzGav

I am also having the same issue with Plex playlists not updating. Not sure if the below is a relevant log snippet but here you go (I see these for both Plex and Youtube Music):

2024-01-23 10:52:33.364 WARNING (MainThread) [music_assistant.music] Sync task for Plex Media Server Library completed with errors Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/music.py", line 571, in run_sync await provider.sync_library(media_types) File "/usr/local/lib/python3.11/site-packages/music_assistant/server/models/music_provider.py", line 366, in sync_library async for prov_item in self._get_library_gen(media_type): File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/plex/__init__.py", line 582, in get_library_albums yield await self._parse_album(album) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/plex/__init__.py", line 375, in _parse_album self._get_item_mapping( File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/plex/__init__.py", line 260, in _get_item_mapping return ItemMapping( ^^^^^^^^^^^^ File "<string>", line 12, in __init__ File "/usr/local/lib/python3.11/site-packages/music_assistant/common/models/media_items.py", line 214, in __post_init__ self.sort_name = create_sort_name(self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/music_assistant/common/helpers/util.py", line 50, in create_sort_name input_str = input_str.lower().strip() ^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'lower'

vhsdream avatar Jan 23 '24 15:01 vhsdream

this may happen if an item has an empty title. I have just added some extra guard in the code to intercept this. Fix in the next beta, beta 139.

marcelveldt avatar Apr 19 '24 19:04 marcelveldt

also fixed the issue that plex playlists are not updating in beta 139

marcelveldt avatar Apr 19 '24 20:04 marcelveldt

@bj61251 please confirm this has been fixed with b139 when it is released

OzGav avatar Apr 19 '24 23:04 OzGav

Closing due no further followup. Assuming fixed.

OzGav avatar Apr 23 '24 00:04 OzGav