+ if i > -1:
+ # Add a new playlist
+ if i >= len(playlists):
+ name = self._get_keyboard(default='', heading="Grooveshark playlist name")
+ if name != '':
+ songIds = []
+ songIds.append(songid)
+ if groovesharkApi.playlistCreateUnique(name, songIds) == 0:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark XBMC', 'Cannot create Grooveshark playlist ', name)
+ else:
+ xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Grooveshark playlist created, 1000, ' + thumbDef + ')')
+ # Existing playlist
+ else:
+ playlist = playlists[i]
+ playlistid = playlist[1]
+ xbmc.log("Add song " + str(songid) + " to playlist " + str(playlistid))
+ ret = groovesharkApi.playlistAddSong(playlistid, songid, 0)
+ if ret == 0:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark XBMC', 'Cannot add to playlist ')
+ else:
+ xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Added song to Grooveshark playlist, 1000, ' + thumbDef + ')')