Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tidalapi library to 0.8.0 #1722

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions music_assistant/server/providers/tidal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@
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 (
Expand Down Expand Up @@ -122,8 +125,8 @@
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(
Expand Down Expand Up @@ -577,7 +580,7 @@ async def get_stream_details(self, item_id: str) -> StreamDetails:
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:
Expand Down Expand Up @@ -826,7 +829,7 @@ def _parse_track(
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,
Expand Down Expand Up @@ -943,6 +946,9 @@ async def _get_media_info(
# 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
2 changes: 1 addition & 1 deletion music_assistant/server/providers/tidal/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down