Added a block for parsing arguments passed with options
-l -limit
-t -type
in the search() function. Arguments are passed inside search_term.
They work as follows:
* -l -limit <number> : sets the limit of results to that number
and raises a ValueError if that number exceeds 50. Default is 10.
* -t -type <album/track/playlist> : sets the type that is requested
from the API about the search query. Raises a ValueError if an arguments
passed is different than track, album, playlist. Default is all three.
Example:
Enter search or URL: <query> -l 30 -t track album
This will result with 30 tracks and 30 albums associated with query.
Options can be passed in any order but the query must be first.
It still works in the same way and no
other functions need to be changed. Just
changed it to store needed data about each
track/album/playlist in a dictionary so
tracking it in the end is simpler.
If a download gets aborted for some reasons, zspotify left behind a 0 length
file which caused the song to be skipped on the next run. This commit checks
for a non-zero filesize before deciding whether to skip the download of an
"existing" file or not.
Added a function to be called in client if
artist_id_str is not None;
download_artist_albums(artist_id_str) that
uses the get_artist_album function to get the
artist's album id's and then downloads each one
with the download_album function.
Also modified get_artist_album function to return
a list of album ids instead of a list of tuples
of album ids and names.
If the Name is not set, the download will fail. With this change the Download will continue and a Error message will show that the Song does not exist anymore