+
+ def makePlaylist(self, albumid, name):
+ userid = self._get_login()
+ if (userid != 0):
+ name_re = re.compile(r'[- ]')
+ nameTokens = name_re.split("- ")
+ name = self._get_keyboard(default=nameTokens[1], heading="Playlist name")
+ album = groovesharkApi.albumGetSongs(albumid, self.songsearchlimit)
+ songids = []
+ for song in album:
+ songids.append(song[1])
+ id = groovesharkApi.playlistCreateUnique(name, songids)
+ if id == 0:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark', 'Cannot create playlist ', name)
+ else:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark', 'You must be logged in ', ' to create a playlist.')
+
+ def removePlaylist(self, playlistid, name):
+ dialog = xbmcgui.Dialog()
+ if dialog.yesno('Grooveshark', name, 'Delete this playlist?') == True:
+ userid = self._get_login()
+ if (userid != 0):
+ groovesharkApi.playlistDelete(playlistid)
+ xbmc.executebuiltin("Container.Refresh")
+ else:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark', 'You must be logged in ', ' to delete a playlist.')
+
+ def renamePlaylist(self, playlistid, name):
+ userid = self._get_login()
+ if (userid != 0):
+ newname = self._get_keyboard(default=name, heading="Playlist name")
+ if groovesharkApi.playlistRename(playlistid, newname) == 0:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark', 'Cannot rename playlist ', name)
+ else:
+ xbmc.executebuiltin("Container.Refresh")
+ else:
+ dialog = xbmcgui.Dialog()
+ dialog.ok('Grooveshark', 'You must be logged in ', ' to rename a playlist.')