From db17002287390a6e2e07ddaa3eb7c025bc13472a Mon Sep 17 00:00:00 2001 From: Jozef Kruszynski <60214390+jozefKruszynski@users.noreply.github.com> Date: Fri, 18 Oct 2024 02:12:01 +0200 Subject: [PATCH] Update tidalapi library to 0.8.0 (#1722) --- .../server/providers/tidal/__init__.py | 18 ++++++++++++------ .../server/providers/tidal/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/music_assistant/server/providers/tidal/__init__.py b/music_assistant/server/providers/tidal/__init__.py index 16c07595..f06defca 100644 --- a/music_assistant/server/providers/tidal/__init__.py +++ b/music_assistant/server/providers/tidal/__init__.py @@ -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 diff --git a/music_assistant/server/providers/tidal/manifest.json b/music_assistant/server/providers/tidal/manifest.json index a0a26065..d21ddd5a 100644 --- a/music_assistant/server/providers/tidal/manifest.json +++ b/music_assistant/server/providers/tidal/manifest.json @@ -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 } diff --git a/requirements_all.txt b/requirements_all.txt index f6fb7cae..6b7b802d 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -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 -- 2.34.1