From 32255fbadddaf1f5c16345b99fcaf4677b436859 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sat, 9 Nov 2024 17:00:46 +0100 Subject: [PATCH 1/3] Fixing naming inconsistency. Fixes tamland/python-tidal#296 --- tidalapi/media.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tidalapi/media.py b/tidalapi/media.py index a063a34..e996923 100644 --- a/tidalapi/media.py +++ b/tidalapi/media.py @@ -86,7 +86,7 @@ def __str__(self) -> str: class MediaMetadataTags(str, Enum): - hires_lossless: str = "HIRES_LOSSLESS" + hi_res_lossless: str = "HIRES_LOSSLESS" lossless: str = "LOSSLESS" dolby_atmos: str = "DOLBY_ATMOS" @@ -442,7 +442,7 @@ def is_hi_res_lossless(self) -> bool: try: if ( self.media_metadata_tags - and MediaMetadataTags.hires_lossless in self.media_metadata_tags + and MediaMetadataTags.hi_res_lossless in self.media_metadata_tags ): return True except: From cfde13bf3c1d602767c7771dcedf4f96eae3b3b8 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sat, 9 Nov 2024 17:08:56 +0100 Subject: [PATCH 2/3] Removed `HIRES` (`HI_RES` / MQA) legacy. Fixes tamland/python-tidal#297 --- tests/test_session.py | 2 +- tidalapi/media.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_session.py b/tests/test_session.py index b123af0..ccea9c7 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -142,7 +142,7 @@ def test_video_quality_defaults_to_best(session): @pytest.mark.parametrize( - "quality", ["LOW", "HIGH", "LOSSLESS", "HI_RES", "HI_RES_LOSSLESS"] + "quality", ["LOW", "HIGH", "LOSSLESS", "HI_RES_LOSSLESS"] ) def test_manually_set_audio_quality_is_preserved(session, quality): session.audio_quality = quality diff --git a/tidalapi/media.py b/tidalapi/media.py index e996923..4462ffa 100644 --- a/tidalapi/media.py +++ b/tidalapi/media.py @@ -58,7 +58,6 @@ class Quality(str, Enum): low_96k: str = "LOW" low_320k: str = "HIGH" high_lossless: str = "LOSSLESS" - hi_res: str = "HI_RES" hi_res_lossless: str = "HI_RES_LOSSLESS" default: str = low_320k @@ -480,7 +479,7 @@ class Stream: audio_mode: str = AudioMode.stereo # STEREO, DOLBY_ATMOS audio_quality: str = ( Quality.low_320k - ) # LOW, HIGH, LOSSLESS, HI_RES, HI_RES_LOSSLESS + ) # LOW, HIGH, LOSSLESS, HI_RES_LOSSLESS manifest_mime_type: str = "" manifest_hash: str = "" manifest: str = "" From 696b97a84ec280762034830029a58e60a976c99c Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sat, 9 Nov 2024 18:06:17 +0100 Subject: [PATCH 3/3] Reformatting. --- tests/test_session.py | 4 +--- tidalapi/media.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/test_session.py b/tests/test_session.py index ccea9c7..7852de7 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -141,9 +141,7 @@ def test_video_quality_defaults_to_best(session): assert session.video_quality == "HIGH" -@pytest.mark.parametrize( - "quality", ["LOW", "HIGH", "LOSSLESS", "HI_RES_LOSSLESS"] -) +@pytest.mark.parametrize("quality", ["LOW", "HIGH", "LOSSLESS", "HI_RES_LOSSLESS"]) def test_manually_set_audio_quality_is_preserved(session, quality): session.audio_quality = quality assert session.audio_quality == quality diff --git a/tidalapi/media.py b/tidalapi/media.py index 4462ffa..1aaadad 100644 --- a/tidalapi/media.py +++ b/tidalapi/media.py @@ -477,9 +477,7 @@ class Stream: track_id: int = -1 audio_mode: str = AudioMode.stereo # STEREO, DOLBY_ATMOS - audio_quality: str = ( - Quality.low_320k - ) # LOW, HIGH, LOSSLESS, HI_RES_LOSSLESS + audio_quality: str = Quality.low_320k # LOW, HIGH, LOSSLESS, HI_RES_LOSSLESS manifest_mime_type: str = "" manifest_hash: str = "" manifest: str = ""