From: Marcel van der Veldt Date: Tue, 18 Feb 2025 12:31:53 +0000 (+0100) Subject: Don't use set in artist splitter X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=c4dd04fa5f04bdac4954d65f6d4512bef613dc8a;p=music-assistant-server.git Don't use set in artist splitter --- diff --git a/music_assistant/helpers/tags.py b/music_assistant/helpers/tags.py index fd55969b..54256547 100644 --- a/music_assistant/helpers/tags.py +++ b/music_assistant/helpers/tags.py @@ -57,7 +57,7 @@ def split_artists( org_artists: str | tuple[str, ...], allow_ampersand: bool = False ) -> tuple[str, ...]: """Parse all artists from a string.""" - final_artists = set() + final_artists: list[str] = [] # when not using the multi artist tag, the artist string may contain # multiple artists in freeform, even featuring artists may be included in this # string. Try to parse the featuring artists and separate them. @@ -70,7 +70,9 @@ def split_artists( if splitter not in item: continue for subitem in item.split(splitter): - final_artists.add(subitem.strip()) + clean_item = subitem.strip() + if clean_item and clean_item not in final_artists: + final_artists.append(subitem.strip()) if not final_artists: # none of the extra splitters was found return artists