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

Feature/v.0.7.7 prep2 #280

Merged
merged 18 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
10 changes: 9 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ History
=======
v0.7.7
------
* Feat.: Provide "Share Link", "Listen link" as an attribute to album/artist/media. Add relevant tests (Fixes #266) - tehkillerbee_
* Tests: Fix all tests that previously failed. - tehkillerbee_
* Use enum to specify default audio / video quality - tehkillerbee_
* Bugfix: Recent TIDAL changes resulted in missing Mix not causing a ObjectNotFound exception. - tehkillerbee_
* Bugfix: Ensure manifest.codecs always uses a Codec type for both MPD and BTS. - tehkillerbee_
* Added additional tests to verify stream formats (Relates to #252) - tehkillerbee_
* BREAKING: Fix naming of getters to align with python naming convention and avoid confusion (Fixes #255) - tehkillerbee_
* Bugfix: Use correct internal type int for relevant IDs (Fixes #260) - tehkillerbee_
* Bugfix: Fix linting for audio_modes. Update tests (Fixes #261) - tehkillerbee_
* Feat.: Provide "Share Link", "Listen link" as an attribute to album/artist/media/playlist/. Update relevant tests (Fixes #266) - tehkillerbee_
* Allow switching authentication method oauth/pkce for tests. Default: oauth - tehkillerbee_
* Tests: Added track stream tests (BTS, MPD) - tehkillerbee_
* Bugfix: Always use last element in segment timeline. (Fixes #273) - tehkillerbee_
Expand Down
42 changes: 42 additions & 0 deletions tests/test_album.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import tidalapi
from tidalapi.album import Album
from tidalapi.exceptions import MetadataNotAvailable, ObjectNotFound
from tidalapi.media import AudioMode, Quality

from .cover import verify_image_cover, verify_video_cover

Expand All @@ -36,15 +37,22 @@ def test_album(session):
assert album.type == "ALBUM"
assert album.duration == 6712
assert album.available
assert album.ad_supported_ready
assert album.allow_streaming
assert album.dj_ready
assert album.audio_modes == ["STEREO"]
assert album.audio_quality == Quality.high_lossless
assert album.num_tracks == 22
assert album.num_videos == 0
assert album.num_volumes == 2
assert album.release_date == datetime.datetime(2011, 9, 22)
assert album.available_release_date == datetime.datetime(2011, 9, 22)
assert album.copyright == "Sinuz Recordings (a division of HITT bv)"
assert album.version == "Deluxe"
assert album.cover == "30d83a8c-1db6-439d-84b4-dbfb6f03c44c"
assert album.video_cover is None
assert album.explicit is False
assert album.premium_streaming_only is False
assert album.universal_product_number == "3610151683488"
assert 0 < album.popularity < 100
assert album.artist.name == "Lasgo"
Expand Down Expand Up @@ -152,3 +160,37 @@ def test_album_type_single(session):
def test_album_type_ep(session):
album = session.album(289261563)
assert album.type == "EP"


def test_album_quality_atmos(session):
# Session should allow highest possible quality (but will fallback to highest available album quality)
session.audio_quality = Quality.hi_res_lossless
album = session.album("355472560") # DOLBY_ATMOS
assert album.audio_quality == Quality.low_96k
assert album.audio_modes == [AudioMode.dolby_atmos]
assert "DOLBY_ATMOS" in album.media_metadata_tags


def test_album_quality_max(session):
# Session should allow highest possible quality (but will fallback to highest available album quality)
session.audio_quality = Quality.high_lossless
album = session.album("355473696") # MAX (LOSSLESS, 16bit/48kHz)
assert album.audio_quality == Quality.high_lossless
assert album.audio_modes == [AudioMode.stereo]
assert "LOSSLESS" in album.media_metadata_tags


def test_album_quality_max_lossless(session):
# Session should allow highest possible quality (but will fallback to highest available album quality)
session.audio_quality = Quality.hi_res_lossless
album = session.album("355473675") # MAX (HI_RES_LOSSLESS, 24bit/192kHz)
assert (
album.audio_quality == Quality.high_lossless
) # Expected HI_RES_LOSSLESS here. TIDAL bug perhaps?
assert album.audio_modes == [AudioMode.stereo]
assert "HIRES_LOSSLESS" in album.media_metadata_tags


def test_reset_session_quality(session):
# HACK: Make sure to reset audio quality to default value for remaining tests
session.audio_quality = Quality.default
2 changes: 0 additions & 2 deletions tests/test_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def test_get_albums(session):
session.album(17927863),
session.album(36292296),
session.album(17925106),
session.album(17782044),
session.album(17926279),
]

Expand Down Expand Up @@ -93,7 +92,6 @@ def test_get_top_tracks(session):
session.track(17927865),
session.track(17927867),
session.track(17926280),
session.track(17782052),
session.track(17927869),
]

Expand Down
Loading
Loading