Fix parsing of album and views in parse_playlist_items (#552)
* Fix parsing of album and views in parse_playlist_items
Parse album and views columns as a function of flex column count and is_album property to cater for varying layouts with three and four flex columns
* Add "own_playlist" attribute to playlists
To allow for an easy distinction between owned / editable and community / non-editable playlists,in applications incorporating ytmusicapi, a boolean "own_playlist" dictionary entry is added to playlists based on existing code already identifying this property.
* Add thumbnails to episodes
Add thumbnails to episodes for visual rendering in Kodi etc.
* Add unit test for playlist "own_playlist" attribut
Add unit test for playlist "own_playlist" attribut
* Improvements as requested
- rename attribute for own playlists to playlist("owned")
- filter out episode thumbnails with an non-functional URL
* Fix linter in test_playlists.py
Fix test for playlist["owned"]
* Auto-Formatting on playlists.py
* format parsers/podcasts.py
* Remove filtering of podcast thumbnails
No idea why I had seen useless images for those thumbnails before - maybe Google fixed something to make them work?
This commit is contained in:
parent
7ffe990c93
commit
d143480ae4
4 changed files with 9 additions and 6 deletions
|
|
@ -11,6 +11,7 @@ class TestPlaylists:
|
|||
assert len(playlist["duration"]) > 5
|
||||
assert len(playlist["tracks"]) > 200
|
||||
assert "suggestions" not in playlist
|
||||
assert playlist["owned"] is False
|
||||
|
||||
yt.get_playlist("RDATgXd-")
|
||||
assert len(playlist["tracks"]) >= 100
|
||||
|
|
@ -24,6 +25,7 @@ class TestPlaylists:
|
|||
assert len(playlist["tracks"]) < 100
|
||||
assert len(playlist["suggestions"]) == 21
|
||||
assert len(playlist["related"]) == 10
|
||||
assert playlist["owned"] is True
|
||||
|
||||
def test_edit_playlist(self, config, yt_brand):
|
||||
playlist = yt_brand.get_playlist(config["playlists"]["own"])
|
||||
|
|
|
|||
Loading…
Reference in a new issue