Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on leading and trailing whitespaces in custom schemes #56

Closed
Badgie opened this issue Dec 3, 2019 · 0 comments · Fixed by #62
Closed

Exception on leading and trailing whitespaces in custom schemes #56

Badgie opened this issue Dec 3, 2019 · 0 comments · Fixed by #62
Labels
bug Something isn't working priority: medium Medium priority addition
Milestone

Comments

@Badgie
Copy link
Owner

Badgie commented Dec 3, 2019

If there are leading or trailing whitespaces in input on custom schemes, these will be caused the empty string to be included in the list of seeds - this will cause an exception.

$ spotirec -ac -l 100 --tune min_tempo=160
'0 1 9 31 '
Traceback (most recent call last):
  File "/usr/bin/spotirec", line 727, in <module>
    parse()
  File "/usr/bin/spotirec", line 687, in parse
    print_artists_or_tracks(api.get_top_list('artists', 50, headers=headers))
  File "/usr/bin/spotirec", line 214, in print_artists_or_tracks
    parse_seed_info([data['items'][int(x)] for x in selection.split(' ')])
  File "/usr/bin/spotirec", line 214, in <listcomp>
    parse_seed_info([data['items'][int(x)] for x in selection.split(' ')])
ValueError: invalid literal for int() with base 10: ''
@Badgie Badgie added the bug Something isn't working label Dec 3, 2019
@Badgie Badgie added the priority: medium Medium priority addition label Mar 1, 2020
@Badgie Badgie added this to the v1.2 milestone Mar 7, 2020
@Badgie Badgie closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: medium Medium priority addition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant