mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 04:05:08 +03:00
@@ -400,6 +400,7 @@ def DownloadCommand(
|
||||
playlist = api.getPlaylist(resource.id)
|
||||
logging.info(f"Playlist {playlist.title!r}")
|
||||
offset = 0
|
||||
cover_path = None
|
||||
|
||||
while True:
|
||||
playlist_items = api.getPlaylistItems(playlist.uuid, offset=offset)
|
||||
@@ -414,6 +415,8 @@ def DownloadCommand(
|
||||
|
||||
submitItem(item.item, filename)
|
||||
|
||||
cover_path = Path(filename).parent
|
||||
|
||||
if (
|
||||
playlist_items.limit + playlist_items.offset
|
||||
> playlist_items.totalNumberOfItems
|
||||
@@ -422,6 +425,13 @@ def DownloadCommand(
|
||||
|
||||
offset += playlist_items.limit
|
||||
|
||||
if playlist.squareImage and cover_path:
|
||||
path = Path(PATH) if PATH else ctx.obj.config.download.path
|
||||
cover = Cover(
|
||||
uid=playlist.squareImage, size=ctx.obj.config.cover.size
|
||||
)
|
||||
cover.save(path / cover_path, ctx.obj.config.cover.filename)
|
||||
|
||||
progress.start()
|
||||
|
||||
# TODO: make sure every resource is unique
|
||||
|
||||
Reference in New Issue
Block a user