Skip to content

Commit

Permalink
Use storeid instead of nid. simon-weber/gmusicapi#555
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinphilips committed Mar 9, 2018
1 parent 0affe10 commit 5ddd887
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spotifyscrape/allaccessimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def allaccessimport(playlist=None, username=None, password=None, dry_run=False):
newtrackid, error_reason = search_track(api, search_term, currenttracks)
if newtrackid:
if not dry_run:
api.add_songs_to_playlist(playlist_ref, newtrackid)
#print("Add to {} song {}".format(playlist_ref, newtrackid))
api.add_songs_to_playlist(playlist_ref, [newtrackid])
songs_added = songs_added + 1
else:
failed_tracks.append(trackinfo)
Expand Down Expand Up @@ -136,7 +137,7 @@ def search_track(api, search_term, currenttracks):
return None, "Search Failed"

if len(results['song_hits']) > 0:
newtrackid = results['song_hits'][0]['track']['nid']
newtrackid = results['song_hits'][0]['track']['storeId']

if newtrackid in currenttracks:
return None, "Dupe"
Expand Down

0 comments on commit 5ddd887

Please sign in to comment.