From 0c161005d372ec45f6b835b0a35bce1095f6314d Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Mon, 9 May 2022 22:06:22 +0200 Subject: [PATCH] Update filesystem.py (#298) --- music_assistant/providers/filesystem.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 ) -- 2.34.1