Skip to content

Commit c0a6aef

Browse files
authored
Merge pull request #280 from tamland/feature/v.0.7.7-prep2
Feature/v.0.7.7 prep2
2 parents b0e164b + ef12176 commit c0a6aef

File tree

14 files changed

+403
-74
lines changed

14 files changed

+403
-74
lines changed

HISTORY.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ History
44
=======
55
v0.7.7
66
------
7-
* Feat.: Provide "Share Link", "Listen link" as an attribute to album/artist/media. Add relevant tests (Fixes #266) - tehkillerbee_
7+
* Tests: Fix all tests that previously failed. - tehkillerbee_
8+
* Use enum to specify default audio / video quality - tehkillerbee_
9+
* Bugfix: Recent TIDAL changes resulted in missing Mix not causing a ObjectNotFound exception. - tehkillerbee_
10+
* Bugfix: Ensure manifest.codecs always uses a Codec type for both MPD and BTS. - tehkillerbee_
11+
* Added additional tests to verify stream formats (Relates to #252) - tehkillerbee_
12+
* BREAKING: Fix naming of getters to align with python naming convention and avoid confusion (Fixes #255) - tehkillerbee_
13+
* Bugfix: Use correct internal type int for relevant IDs (Fixes #260) - tehkillerbee_
14+
* Bugfix: Fix linting for audio_modes. Update tests (Fixes #261) - tehkillerbee_
15+
* Feat.: Provide "Share Link", "Listen link" as an attribute to album/artist/media/playlist/. Update relevant tests (Fixes #266) - tehkillerbee_
816
* Allow switching authentication method oauth/pkce for tests. Default: oauth - tehkillerbee_
917
* Tests: Added track stream tests (BTS, MPD) - tehkillerbee_
1018
* Bugfix: Always use last element in segment timeline. (Fixes #273) - tehkillerbee_

tests/test_album.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import tidalapi
2626
from tidalapi.album import Album
2727
from tidalapi.exceptions import MetadataNotAvailable, ObjectNotFound
28+
from tidalapi.media import AudioMode, Quality
2829

2930
from .cover import verify_image_cover, verify_video_cover
3031

@@ -36,15 +37,22 @@ def test_album(session):
3637
assert album.type == "ALBUM"
3738
assert album.duration == 6712
3839
assert album.available
40+
assert album.ad_supported_ready
41+
assert album.allow_streaming
42+
assert album.dj_ready
43+
assert album.audio_modes == ["STEREO"]
44+
assert album.audio_quality == Quality.high_lossless
3945
assert album.num_tracks == 22
4046
assert album.num_videos == 0
4147
assert album.num_volumes == 2
4248
assert album.release_date == datetime.datetime(2011, 9, 22)
49+
assert album.available_release_date == datetime.datetime(2011, 9, 22)
4350
assert album.copyright == "Sinuz Recordings (a division of HITT bv)"
4451
assert album.version == "Deluxe"
4552
assert album.cover == "30d83a8c-1db6-439d-84b4-dbfb6f03c44c"
4653
assert album.video_cover is None
4754
assert album.explicit is False
55+
assert album.premium_streaming_only is False
4856
assert album.universal_product_number == "3610151683488"
4957
assert 0 < album.popularity < 100
5058
assert album.artist.name == "Lasgo"
@@ -152,3 +160,37 @@ def test_album_type_single(session):
152160
def test_album_type_ep(session):
153161
album = session.album(289261563)
154162
assert album.type == "EP"
163+
164+
165+
def test_album_quality_atmos(session):
166+
# Session should allow highest possible quality (but will fallback to highest available album quality)
167+
session.audio_quality = Quality.hi_res_lossless
168+
album = session.album("355472560") # DOLBY_ATMOS
169+
assert album.audio_quality == Quality.low_96k
170+
assert album.audio_modes == [AudioMode.dolby_atmos]
171+
assert "DOLBY_ATMOS" in album.media_metadata_tags
172+
173+
174+
def test_album_quality_max(session):
175+
# Session should allow highest possible quality (but will fallback to highest available album quality)
176+
session.audio_quality = Quality.high_lossless
177+
album = session.album("355473696") # MAX (LOSSLESS, 16bit/48kHz)
178+
assert album.audio_quality == Quality.high_lossless
179+
assert album.audio_modes == [AudioMode.stereo]
180+
assert "LOSSLESS" in album.media_metadata_tags
181+
182+
183+
def test_album_quality_max_lossless(session):
184+
# Session should allow highest possible quality (but will fallback to highest available album quality)
185+
session.audio_quality = Quality.hi_res_lossless
186+
album = session.album("355473675") # MAX (HI_RES_LOSSLESS, 24bit/192kHz)
187+
assert (
188+
album.audio_quality == Quality.high_lossless
189+
) # Expected HI_RES_LOSSLESS here. TIDAL bug perhaps?
190+
assert album.audio_modes == [AudioMode.stereo]
191+
assert "HIRES_LOSSLESS" in album.media_metadata_tags
192+
193+
194+
def test_reset_session_quality(session):
195+
# HACK: Make sure to reset audio quality to default value for remaining tests
196+
session.audio_quality = Quality.default

tests/test_artist.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def test_get_albums(session):
5656
session.album(17927863),
5757
session.album(36292296),
5858
session.album(17925106),
59-
session.album(17782044),
6059
session.album(17926279),
6160
]
6261

@@ -93,7 +92,6 @@ def test_get_top_tracks(session):
9392
session.track(17927865),
9493
session.track(17927867),
9594
session.track(17926280),
96-
session.track(17782052),
9795
session.track(17927869),
9896
]
9997

0 commit comments

Comments
 (0)