get_album: rename track_number to trackNumber
This commit is contained in:
parent
9170197457
commit
650bc24d68
4 changed files with 8 additions and 7 deletions
|
|
@ -72,7 +72,7 @@ class TestBrowsing:
|
|||
assert results["tracks"][0]["isExplicit"]
|
||||
assert all(item["views"] is not None for item in results["tracks"])
|
||||
assert all(item["album"] is not None for item in results["tracks"])
|
||||
assert results["tracks"][0]["track_number"] == 1
|
||||
assert results["tracks"][0]["trackNumber"] == 1
|
||||
assert "feedbackTokens" in results["tracks"][0]
|
||||
assert len(results["other_versions"]) >= 1 # appears to be regional
|
||||
results = yt.get_album("MPREb_BQZvl3BFGay")
|
||||
|
|
@ -81,10 +81,10 @@ class TestBrowsing:
|
|||
results = yt.get_album("MPREb_rqH94Zr3NN0")
|
||||
assert len(results["tracks"][0]["artists"]) == 2
|
||||
results = yt.get_album("MPREb_TPH4WqN5pUo") # album with tracks completely removed/missing
|
||||
assert results["tracks"][0]["track_number"] == 3
|
||||
assert results["tracks"][13]["track_number"] == 18
|
||||
assert results["tracks"][0]["trackNumber"] == 3
|
||||
assert results["tracks"][13]["trackNumber"] == 18
|
||||
results = yt.get_album("MPREb_YuigcYm2erf") # album with track (#8) disabled/greyed out
|
||||
assert results["tracks"][7]["track_number"] is None
|
||||
assert results["tracks"][7]["trackNumber"] is None
|
||||
|
||||
def test_get_song(self, config, yt, yt_oauth, sample_video):
|
||||
song = yt_oauth.get_song(config["uploads"]["private_upload_id"]) # private upload
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ class BrowsingMixin(MixinProtocol):
|
|||
returned by :py:func:`search`
|
||||
:return: Dictionary with album and track metadata.
|
||||
|
||||
Each track is in the following format::
|
||||
The result is in the following format::
|
||||
|
||||
{
|
||||
"title": "Revival",
|
||||
|
|
@ -471,6 +471,7 @@ class BrowsingMixin(MixinProtocol):
|
|||
"isExplicit": true,
|
||||
"duration": "5:03",
|
||||
"duration_seconds": 303,
|
||||
"trackNumber": 0,
|
||||
"feedbackTokens": {
|
||||
"add": "AB9zfpK...",
|
||||
"remove": "AB9zfpK..."
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class PlaylistsMixin(MixinProtocol):
|
|||
:return: Dictionary with information about the playlist.
|
||||
The key ``tracks`` contains a List of playlistItem dictionaries
|
||||
|
||||
Each item is in the following format::
|
||||
The result is in the following format::
|
||||
|
||||
{
|
||||
"id": "PLQwVIlKxHM6qv-o99iX9R85og7IzF9YS_",
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def parse_playlist_items(results, menu_entries: Optional[List[List]] = None, is_
|
|||
}
|
||||
|
||||
if is_album:
|
||||
song["track_number"] = int(nav(data, ["index", "runs", 0, "text"])) if isAvailable else None
|
||||
song["trackNumber"] = int(nav(data, ["index", "runs", 0, "text"])) if isAvailable else None
|
||||
|
||||
if duration:
|
||||
song["duration"] = duration
|
||||
|
|
|
|||
Loading…
Reference in a new issue