Chore: Fix browse for filesystem provider
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 5 Feb 2025 07:55:15 +0000 (08:55 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 5 Feb 2025 07:55:15 +0000 (08:55 +0100)
music_assistant/providers/filesystem_local/__init__.py

index 038876ac74199fd59e06b1dc5d3a5f0c43a95786..b9f52054b96ab83ee12a87bfcd0fd0f122e9e18e 100644 (file)
@@ -8,7 +8,7 @@ import logging
 import os
 import os.path
 import time
-from collections.abc import AsyncGenerator, Iterator
+from collections.abc import AsyncGenerator, Iterator, Sequence
 from typing import TYPE_CHECKING, Any, cast
 
 import aiofiles
@@ -249,11 +249,15 @@ class LocalFileSystemProvider(MusicProvider):
             )
         return result
 
-    async def browse(self, path: str) -> list[MediaItemType | ItemMapping]:
+    async def browse(self, path: str) -> Sequence[MediaItemType | ItemMapping]:
         """Browse this provider's items.
 
         :param path: The path to browse, (e.g. provid://artists).
         """
+        if self.media_content_type in ("audiobooks", "podcasts"):
+            # for audiobooks and podcasts just use the default implementation
+            # so we dont have to deal with multi-part audiobooks and podcast episodes
+            return await super().browse(path)
         items: list[MediaItemType | ItemMapping] = []
         item_path = path.split("://", 1)[1]
         if not item_path: