Skip to content

Commit

Permalink
Update ytmusicapi/parsers/playlists.py
Browse files Browse the repository at this point in the history
Co-authored-by: sigma67 <[email protected]>
  • Loading branch information
jcbirdwell and sigma67 authored Jan 14, 2024
1 parent 63cdcc1 commit 0cc590a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ytmusicapi/parsers/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ def parse_playlist_items(results, menu_entries: Optional[List[List]] = None, is_
}

if is_album:
if not isAvailable:
song["track_number"] = None
else:
# returning None from nav is pointless as the keys are always present
song["track_number"] = int(nav(data, ["index", "runs", 0, "text"]))
song["track_number"] = int(nav(data, ["index", "runs", 0, "text"])) if isAvailable else None

if duration:
song["duration"] = duration
Expand Down

0 comments on commit 0cc590a

Please sign in to comment.