From: stephendenham Date: Tue, 21 Dec 2010 10:53:18 +0000 (+0000) Subject: Slight performance improvement. Playlists bug fix. X-Git-Url: https://git.hcoop.net/clinton/xbmc-groove.git/commitdiff_plain/cb06c186e9d602d6914137180526e100a8899172 Slight performance improvement. Playlists bug fix. git-svn-id: svn://svn.code.sf.net/p/xbmc-groove/code@19 2dec19e3-eb1d-4749-8193-008c8bba0994 --- diff --git a/default.py b/default.py index 695ce9c..9fd4167 100644 --- a/default.py +++ b/default.py @@ -63,7 +63,7 @@ class GroovesharkPlaylistSelect(xbmcgui.WindowDialog): 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 @@ -260,7 +260,7 @@ class Groveshark: 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.') @@ -481,6 +481,8 @@ class Groveshark: 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: @@ -519,11 +521,12 @@ class Groveshark: 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) diff --git a/resources/img/popularSongs.png b/resources/img/popularSongs.png dissimilarity index 99% index 1556a52..0a3c134 100644 Binary files a/resources/img/popularSongs.png and b/resources/img/popularSongs.png differ