Update tidalapi library to 0.8.0 (#1722)
authorJozef Kruszynski <60214390+jozefKruszynski@users.noreply.github.com>
Fri, 18 Oct 2024 00:12:01 +0000 (02:12 +0200)
committerGitHub <noreply@github.com>
Fri, 18 Oct 2024 00:12:01 +0000 (02:12 +0200)
music_assistant/server/providers/tidal/__init__.py
music_assistant/server/providers/tidal/manifest.json
requirements_all.txt

index 16c075958b229b8266fee1ba75c7e40211740840..f06defcae3956059879557e9e918e81f8b70e371 100644 (file)
@@ -52,7 +52,10 @@ from music_assistant.common.models.media_items import (
 from music_assistant.common.models.streamdetails import StreamDetails
 from music_assistant.server.helpers.auth import AuthenticationHelper
 from music_assistant.server.helpers.tags import AudioTags, parse_tags
-from music_assistant.server.helpers.throttle_retry import ThrottlerManager, throttle_with_retries
+from music_assistant.server.helpers.throttle_retry import (
+    ThrottlerManager,
+    throttle_with_retries,
+)
 from music_assistant.server.models.music_provider import MusicProvider
 
 from .helpers import (
@@ -122,8 +125,8 @@ _P = ParamSpec("_P")
 class TidalQualityEnum(StrEnum):
     """Enum for Tidal Quality."""
 
-    HIGH_LOSSLESS = "HIGH_LOSSLESS"  # "High - 16bit, 44.1kHz"
-    HI_RES = "HI_RES"  # "Max - Up to 24bit, 192kHz"
+    HIGH_LOSSLESS = "LOSSLESS"  # "High - 16bit, 44.1kHz"
+    HI_RES = "HI_RES_LOSSLESS"  # "Max - Up to 24bit, 192kHz"
 
 
 async def setup(
@@ -577,7 +580,7 @@ class TidalProvider(MusicProvider):
             raise MediaNotFoundError(msg)
         stream: TidalStream = await get_stream(track)
         manifest = stream.get_stream_manifest()
-        if manifest.is_MPD:
+        if stream.is_mpd:
             # for mpeg-dash streams we just pass the complete base64 manifest
             url = f"data:application/dash+xml;base64,{manifest.manifest}"
         else:
@@ -826,7 +829,7 @@ class TidalProvider(MusicProvider):
                     provider_instance=self.instance_id,
                     audio_format=AudioFormat(
                         content_type=ContentType.FLAC,
-                        bit_depth=24 if track_obj.is_HiRes else 16,
+                        bit_depth=24 if track_obj.is_hi_res_lossless else 16,
                     ),
                     url=f"https://tidal.com/track/{track_id}",
                     available=track_obj.available,
@@ -943,6 +946,9 @@ class TidalProvider(MusicProvider):
             # parse info with ffprobe (and store in cache)
             media_info = await parse_tags(url)
             await self.mass.cache.set(
-                item_id, media_info.raw, category=cache_category, base_key=cache_base_key
+                item_id,
+                media_info.raw,
+                category=cache_category,
+                base_key=cache_base_key,
             )
         return media_info
index a0a260658809fcaa37c87432534410798c955412..d21ddd5a6dbab6111cefc3089b566f3c1c3a72ba 100644 (file)
@@ -4,7 +4,7 @@
   "name": "Tidal",
   "description": "Support for the Tidal streaming provider in Music Assistant.",
   "codeowners": ["@jozefKruszynski"],
-  "requirements": ["tidalapi==0.7.6"],
+  "requirements": ["tidalapi==0.8.0"],
   "documentation": "https://music-assistant.io/music-providers/tidal/",
   "multi_instance": true
 }
index f6fb7cae866a98f86c13cac877c3a55115faa687..6b7b802dc7ebb25ba77ad071af0018f554e3301a 100644 (file)
@@ -39,7 +39,7 @@ shortuuid==1.0.13
 snapcast==2.3.6
 soco==0.30.5
 soundcloudpy==0.1.0
-tidalapi==0.7.6
+tidalapi==0.8.0
 unidecode==1.3.8
 xmltodict==0.13.0
 yt-dlp==2024.10.7