- def frown(self, songid):
- userid = self._get_login()
- if (userid != 0):
- xbmc.log("Frown song: " + str(songid))
- if groovesharkApi.radioFrown(songId = songid) != True:
- xbmc.log("Unable to frown song " + str(songid))
- else:
- xbmc.executebuiltin('XBMC.Notification(Grooveshark, Frowned, 1000, ' + thumbDef + ')')
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok('Grooveshark', 'You must be logged in', 'to frown a song.')
-
- def similarArtists(self, artistId):
- similar = groovesharkApi.artistGetSimilar(artistId, limit = self.artistsearchlimit)
- if (len(similar) > 0):
- self._add_artists_directory(similar)
- else:
- dialog = xbmcgui.Dialog()
- dialog.ok('Grooveshark', 'No similar artists.')
- self.categories()
-
- def makePlaylist(self, albumid, name):
- userid = self._get_login()
- if (userid != 0):
- re.split(' - ',name,1)
- nameTokens = re.split(' - ',name,1)
- name = self._get_keyboard(default=nameTokens[0], heading="Playlist name")
- if 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:
- xbmc.executebuiltin('XBMC.Notification(Grooveshark, Playlist created, 1000, ' + thumbDef + ')')
- 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.Update(" + playlistUrl + ",replace)")
- 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 newname == '':
- return
- elif 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.')
-