Skip to content

Commit

Permalink
Fix global cache key and YTMusic playlist edge case. (#1540)
Browse files Browse the repository at this point in the history
Fix global cache key and playlist edge case.
  • Loading branch information
MarvinSchenkel authored Aug 3, 2024
1 parent 698d23d commit ae7ee0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion music_assistant/server/controllers/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ async def refresh_item(
ctrl = self.get_controller(media_type)
is_library_item = media_item.provider == "library"

available_providers = get_global_cache_value("unique_providers")
available_providers = get_global_cache_value("provider_instance_ids")
if TYPE_CHECKING:
available_providers = cast(set[str], available_providers)

Expand Down
2 changes: 2 additions & 0 deletions music_assistant/server/providers/ytmusic/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def _get_playlist():
ytm = ytmusicapi.YTMusic(auth=headers, language=language)
playlist = ytm.get_playlist(playlistId=prov_playlist_id, limit=None)
playlist["checksum"] = get_playlist_checksum(playlist)
# Fix missing playlist id in some edge cases
playlist["id"] = prov_playlist_id if not playlist.get("id") else playlist["id"]
return playlist

return await asyncio.to_thread(_get_playlist)
Expand Down

0 comments on commit ae7ee0f

Please sign in to comment.