Fix filtering and sorting within Artist, Album and Track views (#3131)
authorMarvin Schenkel <marvinschenkel@gmail.com>
Tue, 10 Feb 2026 10:08:20 +0000 (11:08 +0100)
committerGitHub <noreply@github.com>
Tue, 10 Feb 2026 10:08:20 +0000 (11:08 +0100)
Fix filtering and sorting within views

music_assistant/controllers/media/base.py

index 737deec95dfde15e77ba01620b6fca323624d381..9ea0e19eaf377823906809da0286ec6220ee885b 100644 (file)
@@ -859,9 +859,9 @@ class MediaControllerBase[ItemCls: "MediaItemType"](metaclass=ABCMeta):
         extra_join_parts: list[str] | None = None,
     ) -> list[ItemCls]:
         """Fetch MediaItem records from database by building the query."""
-        query_params = extra_query_params or {}
-        query_parts: list[str] = extra_query_parts or []
-        join_parts: list[str] = extra_join_parts or []
+        query_params = dict(extra_query_params) if extra_query_params else {}
+        query_parts: list[str] = list(extra_query_parts) if extra_query_parts else []
+        join_parts: list[str] = list(extra_join_parts) if extra_join_parts else []
         search = self._preprocess_search(search, query_params)
         # create special performant random query
         if order_by and order_by.startswith("random"):