Fix: duplicate search results for podcasts and audiobooks
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 9 Feb 2025 12:38:08 +0000 (13:38 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sun, 9 Feb 2025 12:38:08 +0000 (13:38 +0100)
music_assistant/controllers/media/audiobooks.py
music_assistant/controllers/media/podcasts.py

index 6c58b45b7647bd2fe34d5a7136e10f7f313223ac..f59edc155b053766ab7ff47faeec0ce6161489e4 100644 (file)
@@ -78,7 +78,7 @@ class AudiobooksController(MediaControllerBase[Audiobook, Audiobook]):
         if search and len(result) < 25 and not offset:
             # append author items to result
             extra_query_parts = [
-                "WHERE audiobooks.authors LIKE :search OR audiobooks.name LIKE :search",
+                "WHERE audiobooks.authors LIKE :search or audiobooks.narrators LIKE :search",
             ]
             extra_query_params["search"] = f"%{search}%"
             return result + await self._get_library_items_by_query(
index 5323aefd8a9ddfe8d32699022031631cae3b4478..460141ebfcc247b37f27230b7eedfd81f73fa75b 100644 (file)
@@ -81,7 +81,7 @@ class PodcastsController(MediaControllerBase[Podcast, Podcast]):
         if search and len(result) < 25 and not offset:
             # append publisher items to result
             extra_query_parts = [
-                "WHERE podcasts.publisher LIKE :search OR podcasts.name LIKE :search",
+                "WHERE podcasts.publisher LIKE :search",
             ]
             extra_query_params["search"] = f"%{search}%"
             return result + await self._get_library_items_by_query(