From: Melvyn Harbour Date: Sat, 3 Aug 2024 13:57:23 +0000 (+0100) Subject: Ensure sort_name makes it to cache (#1538) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=0cb1355bf44c79d0412c0757ac4d6a3a7704f8b0;p=music-assistant-server.git Ensure sort_name makes it to cache (#1538) * Ensure sort_name makes it to cache * Lint * Split line * Ruff --------- Co-authored-by: Marvin Schenkel --- diff --git a/music_assistant/server/providers/filesystem_local/base.py b/music_assistant/server/providers/filesystem_local/base.py index aaa64c5e..d464eb78 100644 --- a/music_assistant/server/providers/filesystem_local/base.py +++ b/music_assistant/server/providers/filesystem_local/base.py @@ -748,13 +748,18 @@ class FileSystemProviderBase(MusicProvider): # album artist(s) if tags.album_artists: for index, album_artist_str in enumerate(tags.album_artists): - artist = await self._parse_artist(album_artist_str, album_path=album_dir) + artist = await self._parse_artist( + album_artist_str, + album_path=album_dir, + sort_name=( + tags.album_artist_sort_names[index] + if index < len(tags.album_artist_sort_names) + else None + ), + ) if not artist.mbid: with contextlib.suppress(IndexError): artist.mbid = tags.musicbrainz_albumartistids[index] - # album artist sort name - with contextlib.suppress(IndexError): - artist.sort_name = tags.album_artist_sort_names[index] album_artists.append(artist) else: # album artist tag is missing, determine fallback