mirror of
https://github.com/caseychu/spotify-backup.git
synced 2024-05-11 10:51:31 +00:00
Sort playlists by name
This commit is contained in:
@@ -142,6 +142,7 @@ def main():
|
|||||||
|
|
||||||
# List all playlists and all track in each playlist.
|
# List all playlists and all track in each playlist.
|
||||||
playlists = spotify.list('users/{user_id}/playlists'.format(user_id=me['id']), {'limit': 50})
|
playlists = spotify.list('users/{user_id}/playlists'.format(user_id=me['id']), {'limit': 50})
|
||||||
|
playlists.sort(key=lambda playlist: playlist['name'])
|
||||||
for playlist in playlists:
|
for playlist in playlists:
|
||||||
log('Loading playlist: {name} ({tracks[total]} songs)'.format(**playlist))
|
log('Loading playlist: {name} ({tracks[total]} songs)'.format(**playlist))
|
||||||
playlist['tracks'] = spotify.list(playlist['tracks']['href'], {'limit': 100})
|
playlist['tracks'] = spotify.list(playlist['tracks']['href'], {'limit': 100})
|
||||||
|
|||||||
Reference in New Issue
Block a user