From: Marcel van der Veldt Date: Mon, 9 May 2022 20:06:22 +0000 (+0200) Subject: Update filesystem.py (#298) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=0c161005d372ec45f6b835b0a35bce1095f6314d;p=music-assistant-server.git Update filesystem.py (#298) --- diff --git a/music_assistant/providers/filesystem.py b/music_assistant/providers/filesystem.py index 28b0d2ff..9a819f55 100644 --- a/music_assistant/providers/filesystem.py +++ b/music_assistant/providers/filesystem.py @@ -276,7 +276,6 @@ class FileSystemProvider(MusicProvider): async def get_stream_details(self, item_id: str) -> StreamDetails: """Return the content details for the given track when it will be streamed.""" - filename = item_id if os.sep in item_id: # this is already a filename itempath = item_id @@ -286,7 +285,7 @@ class FileSystemProvider(MusicProvider): raise MediaNotFoundError(f"Track path does not exist: {itempath}") def parse_tag(): - return TinyTag.get(filename) + return TinyTag.get(itempath) tag = await self.mass.loop.run_in_executor(None, parse_tag) @@ -294,8 +293,8 @@ class FileSystemProvider(MusicProvider): type=StreamType.FILE, provider=self.id, item_id=item_id, - content_type=ContentType(filename.split(".")[-1]), - path=filename, + content_type=ContentType(itempath.split(".")[-1]), + path=itempath, sample_rate=tag.samplerate or 44100, bit_depth=16, # TODO: parse bitdepth )