Open jikamens opened 7 years ago
if a song is not found then i get:
Traceback (most recent call last):
File "ImportList.py", line 301, in <module>
search_result = search_for_track(smart_details)
File "ImportList.py", line 125, in search_for_track
top_result = best_match(details, search_results)
File "ImportList.py", line 86, in best_match
return pairs[0][0]
Thanks for these scripts! I found them quite useful and I was glad not to have to write them from scratch myself!
I'm submitting some changes which I believe are improvements. I've tried to isolate them logically in separate commits.
The only change I'm unsure about is 583f17c. Your code uses the "storeId" field, if it is returned by the API, rather than the "id" field. I found that none of the songs for which the API returned a "storeId" were actually being added to my playlists. When I modified the code to always use "id", all of those songs were imported properly into my playlists.
Since I don't understand the API or your usage of it well enough to understand why "storeId" was being used in your code, I don't know what the global ramifications of my change are. All I know is that, for me at least, the import worked properly without "storeId", and improperly with it.
I've mentioned this change first because as I said it's the one change I can't say for certain is correct. Here are the other changes, which I'm much more confident about: