Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed May 4, 2024
1 parent 15faeb4 commit 79a1186
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/mixins/test_playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_edit_playlist(self, config, yt_brand):
)
assert response == "STATUS_SUCCEEDED", "Playlist edit failed"

def test_end2end(self, config, yt_brand, sample_video):
def test_end2end(self, yt_brand, sample_video):
playlist_id = yt_brand.create_playlist(
"test",
"test description",
Expand Down
6 changes: 4 additions & 2 deletions ytmusicapi/parsers/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

def parse_playlist_header(response: Dict) -> Dict[str, Any]:
playlist: Dict[str, Any] = {}
header = nav(response, HEADER_DETAIL)
editable_header = nav(response, [*HEADER, *EDITABLE_PLAYLIST_DETAIL_HEADER], True)
playlist["owned"] = editable_header is not None
playlist["privacy"] = "PUBLIC"
if editable_header is not None:
if editable_header is not None: # owned playlist
header = nav(editable_header, HEADER_DETAIL)
playlist["privacy"] = editable_header["editHeader"]["musicPlaylistEditHeaderRenderer"]["privacy"]
else:
header = nav(response, HEADER_DETAIL, True)

playlist["title"] = nav(header, TITLE_TEXT)
playlist["thumbnails"] = nav(header, THUMBNAIL_CROPPED)
Expand Down

0 comments on commit 79a1186

Please sign in to comment.