Open bschifferer opened 6 years ago
We encountered the same bug. This error was produced by using specificed 0 option to generate a list of songs for a user
1: Rock
2: Hip Hop
3: Pop
4: Dance/Electronic
5: Latin
6: Country
7: R&B
0
Enter the length of your workout in minutes:
10
Enter the start speed of your workout in steps per minute (SPM):
100
Enter the end speed of your workout in steps per minute (SPM):
50
Scanning library
Traceback (most recent call last):
File "bpm.py", line 37, in <module>
main()
File "bpm.py", line 28, in main
playlist = run_gen(token, genre, length, start_speed, end_speed)
File "/Users/limxiaoyu/Downloads/bpm-master/src/generation.py", line 151, in run_gen
library = scan_library(spotify, genre, start_speed, end_speed)
File "/Users/limxiaoyu/Downloads/bpm-master/src/generation.py", line 64, in scan_library
if not has_genre(spotify, track, genre):
File "/Users/limxiaoyu/Downloads/bpm-master/src/generation.py", line 41, in has_genre
target_genre = GENRES[genre]
KeyError: 0
Description: If I registered at BPM and add my Spotify API Code and select that I have no music preference (Genre Key 0), then the programm will crash later
Expected behavior: If I don’t select any preferences (Genre Key 0), the generated playlist will include all genres.