The branch, eden has been updated
via 168f35c4507d9a33de0271d67907d9870967df9c (commit)
from 3ce504556b31e2fcc15ef9b734f854a3f127234d (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=168f35c4507d9a33de0271d67907d9870967df9c
commit 168f35c4507d9a33de0271d67907d9870967df9c
Author: ronie <[email protected]>
Date: Fri Mar 23 21:30:22 2012 +0100
[script.globalsearch] -v0.2.3
use label for seasons instead of title
diff --git a/script.globalsearch/addon.xml b/script.globalsearch/addon.xml
index d69537d..92f5d35 100644
--- a/script.globalsearch/addon.xml
+++ b/script.globalsearch/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.globalsearch" name="Global Search" version="0.2.2"
provider-name="ronie">
+<addon id="script.globalsearch" name="Global Search" version="0.2.3"
provider-name="ronie">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/script.globalsearch/changelog.txt
b/script.globalsearch/changelog.txt
index d4523dc..39e2883 100644
--- a/script.globalsearch/changelog.txt
+++ b/script.globalsearch/changelog.txt
@@ -1,3 +1,7 @@
+v0.2.3
+- use label for seasons
+- sort by label instead of title
+
v0.2.2
- use title instead of label
diff --git a/script.globalsearch/resources/lib/gui.py
b/script.globalsearch/resources/lib/gui.py
index 14d822e..211c87a 100644
--- a/script.globalsearch/resources/lib/gui.py
+++ b/script.globalsearch/resources/lib/gui.py
@@ -1,4 +1,5 @@
import sys, re, datetime
+from operator import itemgetter #needed for sorting workaround
import xbmc, xbmcgui
import contextmenu, infodialog
if sys.version_info < (2, 7):
@@ -118,7 +119,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
listitems = []
self.getControl( 191 ).setLabel( '[B]' + xbmc.getLocalizedString(342)
+ '[/B]' )
count = 0
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMovies", "params": {"properties": ["title", "streamdetails",
"genre", "studio", "year", "tagline", "plot", "plotoutline", "runtime",
"fanart", "thumbnail", "file", "trailer", "playcount", "rating", "mpaa",
"director", "writer"], "sort": { "method": "title" } }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMovies", "params": {"properties": ["title", "streamdetails",
"genre", "studio", "year", "tagline", "plot", "plotoutline", "runtime",
"fanart", "thumbnail", "file", "trailer", "playcount", "rating", "mpaa",
"director", "writer"], "sort": { "method": "label" } }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('movies')):
@@ -217,7 +218,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
listitems = []
self.getControl( 191 ).setLabel( '[B]' +
xbmc.getLocalizedString(20343) + '[/B]' )
count = 0
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetTVShows", "params": {"properties": ["title", "genre",
"studio", "premiered", "plot", "fanart", "thumbnail", "playcount", "year",
"mpaa", "episode", "rating"], "sort": { "method": "title" } }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetTVShows", "params": {"properties": ["title", "genre",
"studio", "premiered", "plot", "fanart", "thumbnail", "playcount", "year",
"mpaa", "episode", "rating"], "sort": { "method": "label" } }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('tvshows')):
@@ -266,7 +267,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
listitems = []
self.getControl( 191 ).setLabel( '[B]' +
xbmc.getLocalizedString(20343) + '[/B]' )
count = 0
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetSeasons", "params": {"properties": ["title", "showtitle",
"season", "fanart", "thumbnail", "playcount", "episode"], "sort": { "method":
"title" }, "tvshowid":%s }, "id": 1}' % self.tvshowid)
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetSeasons", "params": {"properties": ["showtitle", "season",
"fanart", "thumbnail", "playcount", "episode"], "sort": { "method": "label" },
"tvshowid":%s }, "id": 1}' % self.tvshowid)
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('seasons')):
@@ -278,7 +279,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
episode = str(item['episode'])
fanart = item['fanart']
path = 'videodb://2/2/' + self.tvshowid + '/' +
str(item['season']) + '/'
- season = item['title']
+ season = item['label']
playcount = str(item['playcount'])
thumb = item['thumbnail']
listitem = xbmcgui.ListItem(label=season,
iconImage='DefaultVideo.png', thumbnailImage=thumb)
@@ -309,6 +310,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('episodes')):
+ json_response['result']['episodes'].sort(key=itemgetter('title'))
#workaround, sort method 'title' is broken in json-rpc
for item in json_response['result']['episodes']:
if self.fetch_seasonepisodes == 'true':
episode = item['showtitle']
@@ -404,7 +406,7 @@ class GUI( xbmcgui.WindowXMLDialog ):
listitems = []
self.getControl( 191 ).setLabel( '[B]' +
xbmc.getLocalizedString(20389) + '[/B]' )
count = 0
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMusicVideos", "params": {"properties": ["title",
"streamdetails", "runtime", "genre", "studio", "artist", "album", "year",
"plot", "fanart", "thumbnail", "file", "playcount", "director"], "sort": {
"method": "title" } }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMusicVideos", "params": {"properties": ["title",
"streamdetails", "runtime", "genre", "studio", "artist", "album", "year",
"plot", "fanart", "thumbnail", "file", "playcount", "director"], "sort": {
"method": "label" } }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('musicvideos')):
@@ -412,7 +414,6 @@ class GUI( xbmcgui.WindowXMLDialog ):
musicvideo = item['title']
musicvideomatch = re.search( '.*' + self.searchstring + '.*',
musicvideo, re.I )
if musicvideomatch:
- log("match")
count = count + 1
album = item['album']
artist = item['artist']
@@ -545,9 +546,9 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.getControl( 191 ).setLabel( '[B]' + xbmc.getLocalizedString(132)
+ '[/B]' )
count = 0
if self.fetch_albumssongs == 'true':
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "description",
"albumlabel", "artist", "genre", "year", "thumbnail", "fanart", "theme",
"type", "mood", "style", "rating"], "sort": { "method": "title" },
"artistid":%s }, "id": 1}' % self.artistid)
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "description",
"albumlabel", "artist", "genre", "year", "thumbnail", "fanart", "theme",
"type", "mood", "style", "rating"], "sort": { "method": "label" },
"artistid":%s }, "id": 1}' % self.artistid)
else:
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "description",
"albumlabel", "artist", "genre", "year", "thumbnail", "fanart", "theme",
"type", "mood", "style", "rating"], "sort": { "method": "title" } }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "description",
"albumlabel", "artist", "genre", "year", "thumbnail", "fanart", "theme",
"type", "mood", "style", "rating"], "sort": { "method": "label" } }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('albums')):
@@ -581,7 +582,6 @@ class GUI( xbmcgui.WindowXMLDialog ):
starrating = 'rating%.1d.png' %
round(float(int(rating))/2)
else:
starrating = 'rating0.png'
- log('starrating: %s' % starrating)
style = item['style']
theme = item['theme']
albumtype = item['type']
@@ -616,9 +616,9 @@ class GUI( xbmcgui.WindowXMLDialog ):
self.getControl( 191 ).setLabel( '[B]' + xbmc.getLocalizedString(134)
+ '[/B]' )
count = 0
if self.fetch_albumssongs == 'true':
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["title", "artist", "album",
"genre", "duration", "year", "file", "thumbnail", "fanart", "comment",
"rating", "track", "playcount"], "sort": { "method": "title" }, "artistid":%s
}, "id": 1}' % self.artistid)
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["title", "artist", "album",
"genre", "duration", "year", "file", "thumbnail", "fanart", "comment",
"rating", "track", "playcount"], "sort": { "method": "label" }, "artistid":%s
}, "id": 1}' % self.artistid)
else:
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["title", "artist", "album",
"genre", "duration", "year", "file", "thumbnail", "fanart", "comment",
"rating", "track", "playcount"], "sort": { "method": "title" } }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["title", "artist", "album",
"genre", "duration", "year", "file", "thumbnail", "fanart", "comment",
"rating", "track", "playcount"], "sort": { "method": "label" } }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
if (json_response['result'] != None) and
(json_response['result'].has_key('songs')):
-----------------------------------------------------------------------
Summary of changes:
script.globalsearch/addon.xml | 2 +-
script.globalsearch/changelog.txt | 4 ++++
script.globalsearch/resources/lib/gui.py | 22 +++++++++++-----------
3 files changed, 16 insertions(+), 12 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons