From dd3d3a36c4327024911304c366284b695b306820 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 6 Mar 2025 15:16:56 +0100 Subject: [PATCH] Fix: determine content type from file extension --- music_assistant/providers/filesystem_local/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/music_assistant/providers/filesystem_local/__init__.py b/music_assistant/providers/filesystem_local/__init__.py index be2dc8c7..e96c39f5 100644 --- a/music_assistant/providers/filesystem_local/__init__.py +++ b/music_assistant/providers/filesystem_local/__init__.py @@ -882,7 +882,7 @@ class LocalFileSystemProvider(MusicProvider): provider_domain=self.domain, provider_instance=self.instance_id, audio_format=AudioFormat( - content_type=ContentType.try_parse(tags.format), + content_type=ContentType.try_parse(file_item.ext or tags.format), sample_rate=tags.sample_rate, bit_depth=tags.bits_per_sample, channels=tags.channels, @@ -1104,7 +1104,7 @@ class LocalFileSystemProvider(MusicProvider): provider_domain=self.domain, provider_instance=self.instance_id, audio_format=AudioFormat( - content_type=ContentType.try_parse(tags.format), + content_type=ContentType.try_parse(file_item.ext or tags.format), sample_rate=tags.sample_rate, bit_depth=tags.bits_per_sample, channels=tags.channels, @@ -1202,7 +1202,7 @@ class LocalFileSystemProvider(MusicProvider): provider_domain=self.domain, provider_instance=self.instance_id, audio_format=AudioFormat( - content_type=ContentType.try_parse(tags.format), + content_type=ContentType.try_parse(file_item.ext or tags.format), sample_rate=tags.sample_rate, bit_depth=tags.bits_per_sample, channels=tags.channels, @@ -1593,7 +1593,7 @@ class LocalFileSystemProvider(MusicProvider): provider=self.instance_id, item_id=item_id, audio_format=AudioFormat( - content_type=ContentType.try_parse(tags.format), + content_type=ContentType.try_parse(file_item.ext or tags.format), sample_rate=tags.sample_rate, bit_depth=tags.bits_per_sample, channels=tags.channels, -- 2.34.1