+ re.split(' - ',name,1)
+ nameTokens = re.split(' - ',name,1)
+ name = self._get_keyboard(default=nameTokens[0], heading="Grooveshark playlist name")
+ if name != '':
+ groovesharkApi.setRemoveDuplicates(True)
+ album = groovesharkApi.albumGetSongs(albumid, self.songsearchlimit)
+ songids = []
+ for song in album:
+ songids.append(song[1])
+ 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 + ')')
+ else:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark XBMC', 'You must be logged in ', ' to create a Grooveshark playlist.')
+
+ def removePlaylist(self, playlistid, name):
+ dialog = xbmcgui.Dialog()
+ if dialog.yesno('Grooveshark XBMC', name, 'Delete this Grooveshark playlist?') == True:
+ userid = self._get_login()
+ if (userid != 0):
+ groovesharkApi.playlistDelete(playlistid)
+ xbmc.executebuiltin("Container.Refresh(" + playlistsUrl + ")")
+ else:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark XBMC', 'You must be logged in ', ' to delete a Grooveshark playlist.')
+
+ def removePlaylistSong(self, playlistid, playlistname, songpos):
+ dialog = xbmcgui.Dialog()
+ if dialog.yesno('Grooveshark XBMC', 'Delete this song from the Grooveshark playlist?') == True:
+ userid = self._get_login()
+ if (userid != 0):
+ if groovesharkApi.playlistDeleteSong(playlistid, songpos) == 0:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark XBMC', 'Failed to remove ', ' song from Grooveshark playlist.')
+ else:
+ xbmc.executebuiltin("Container.Refresh(" + playlistUrl + "&id="+str(playlistid) + "&name=" + playlistname + ",replace)")