mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2025-12-26 18:50:28 +00:00
Playlist num zero fill based on playlist size.
This commit is contained in:
@@ -83,8 +83,9 @@ def download_from_urls(urls: list[str]) -> bool:
|
|||||||
playlist_songs = get_playlist_songs(playlist_id)
|
playlist_songs = get_playlist_songs(playlist_id)
|
||||||
name, _ = get_playlist_info(playlist_id)
|
name, _ = get_playlist_info(playlist_id)
|
||||||
enum = 1
|
enum = 1
|
||||||
|
char_num = len(str(len(playlist_songs)))
|
||||||
for song in playlist_songs:
|
for song in playlist_songs:
|
||||||
download_track('playlist', song[TRACK][ID], extra_keys={'playlist': name, 'playlist_num': str(enum).zfill(3)})
|
download_track('playlist', song[TRACK][ID], extra_keys={'playlist': name, 'playlist_num': str(enum).zfill(char_num)})
|
||||||
enum += 1
|
enum += 1
|
||||||
elif episode_id is not None:
|
elif episode_id is not None:
|
||||||
download = True
|
download = True
|
||||||
|
|||||||
Reference in New Issue
Block a user