diff --git a/tests/mixins/test_browsing.py b/tests/mixins/test_browsing.py index f3eba1ad..75a645ec 100644 --- a/tests/mixins/test_browsing.py +++ b/tests/mixins/test_browsing.py @@ -61,7 +61,7 @@ def test_get_album(self, yt, yt_auth, sample_album, badly_indexed_album): 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_position"] == 1 + assert results["tracks"][0]["track_number"] == 1 assert "feedbackTokens" in results["tracks"][0] assert len(results["other_versions"]) >= 1 # appears to be regional results = yt.get_album("MPREb_BQZvl3BFGay") @@ -70,8 +70,8 @@ def test_get_album(self, yt, yt_auth, sample_album, badly_indexed_album): results = yt.get_album("MPREb_rqH94Zr3NN0") assert len(results["tracks"][0]["artists"]) == 2 results = yt.get_album(badly_indexed_album) # album with non-standard indexing - assert results["tracks"][0]["track_position"] == 3 - assert results["tracks"][13]["track_position"] == 18 + assert results["tracks"][0]["track_number"] == 3 + assert results["tracks"][13]["track_number"] == 18 def test_get_song(self, config, yt, yt_oauth, sample_video): song = yt_oauth.get_song(config["uploads"]["private_upload_id"]) # private upload diff --git a/ytmusicapi/parsers/playlists.py b/ytmusicapi/parsers/playlists.py index a71077d6..fb7f3fca 100644 --- a/ytmusicapi/parsers/playlists.py +++ b/ytmusicapi/parsers/playlists.py @@ -94,8 +94,8 @@ def parse_playlist_items(results, menu_entries: Optional[List[List]] = None, is_ } if is_album: - track_pos_found = nav(data, ["index", "runs", 0, "text"], True) - song["track_position"] = track_pos_found if track_pos_found is None else int(track_pos_found) + track_idx_found = nav(data, ["index", "runs", 0, "text"], True) + song["track_number"] = track_idx_found if track_idx_found is None else int(track_idx_found) if duration: song["duration"] = duration