self.imgBg = xbmcgui.ControlImage(x+gap, 5*gap+y, w-2*gap, h-5*gap, listBackground)
self.addControl(self.imgBg)
- self.playlistControl = xbmcgui.ControlList(2*gap+x, y+3*gap+30, w-4*gap, h-10*gap, textColor='0xFFFFFFFF', selectedColor='0xFFFF4242', itemTextYOffset=0, itemHeight=30, alignmentY = 0)
+ self.playlistControl = xbmcgui.ControlList(2*gap+x, y+3*gap+30, w-4*gap, h-10*gap, textColor='0xFFFFFFFF', selectedColor='0xFFFF4242', itemTextYOffset=0, itemHeight=50, alignmentY = 0)
self.addControl(self.playlistControl)
self.lastPos = 0
groovesharkApi.unfavoriteSong(songID = songid)
xbmc.executebuiltin('XBMC.Notification(Grooveshark XBMC, Removed from Grooveshark favorites, 1000, ' + thumbDef + ')')
if (int(prevMode) == MODE_FAVORITES):
- xbmc.executebuiltin("Container.Update(" + favoritesUrl + ")")
+ xbmc.executebuiltin("Container.Refresh(" + favoritesUrl + ")")
else:
dialog = xbmcgui.Dialog()
dialog.ok('Grooveshark XBMC', 'You must be logged in', 'to remove Grooveshark favorites.')
def _add_songs_directory(self, songs, playlistid=0, playlistname='', isFavorites=False):
n = len(songs)
xbmc.log("Found " + str(n) + " songs...")
+ progressDialog = xbmcgui.DialogProgress()
+ progressDialog.create('Grooveshark XBMC', 'Fetching songs')
dirItems = []
i = 0
while i < n:
item.addContextMenuItems(menuItems, replaceItems=False)
dirItem = (u, item, False)
dirItems.append(dirItem)
- if i % 5 == 0:
- xbmcplugin.addDirectoryItems(int(sys.argv[1]), dirItems ,n)
- dirItems = []
i = i + 1
-
+ progressDialog.update(int((i*100)/n))
+ if progressDialog.iscanceled():
+ break
+
+ progressDialog.close()
xbmcplugin.addDirectoryItems(int(sys.argv[1]), dirItems ,n)
xbmcplugin.setContent(self._handle, 'songs')
xbmcplugin.setPluginFanart(int(sys.argv[1]), self.fanImg)