The branch, eden has been updated
via 3668f75621fda24a291bd4f9522bd7beeeb2f75f (commit)
from 67f4577e7814541f0de4712e502e3b4c1eb17a11 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=3668f75621fda24a291bd4f9522bd7beeeb2f75f
commit 3668f75621fda24a291bd4f9522bd7beeeb2f75f
Author: ronie <[email protected]>
Date: Tue Mar 20 18:04:13 2012 +0100
[script.randomitems] -v3.0.9
use title instead of label
diff --git a/script.randomitems/RandomItems.py
b/script.randomitems/RandomItems.py
index 5cf20b5..ec73b75 100644
--- a/script.randomitems/RandomItems.py
+++ b/script.randomitems/RandomItems.py
@@ -5,15 +5,19 @@
# * ppic, Hitcher & ronie for the updates
import xbmc, xbmcgui, xbmcaddon
-import re, sys, os, random, simplejson
+import re, sys, os, random
from elementtree import ElementTree as xmltree
+if sys.version_info < (2, 7):
+ import simplejson
+else:
+ import json as simplejson
__addon__ = xbmcaddon.Addon()
__addonid__ = __addon__.getAddonInfo('id')
__addonversion__ = __addon__.getAddonInfo('version')
def log(txt):
- message = '%s: %s' % (__addonid__,txt)
+ message = '%s: %s' % (__addonid__, txt)
xbmc.log(msg=message, level=xbmc.LOGDEBUG)
class Main:
@@ -79,7 +83,7 @@ class Main:
def _fetch_movie_info( self ):
# query the database
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMovies", "params": {"properties": ["playcount", "year",
"plot", "runtime", "fanart", "thumbnail", "file", "trailer", "rating"] }, "id":
1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMovies", "params": {"properties": ["title", "playcount",
"year", "plot", "runtime", "fanart", "thumbnail", "file", "trailer", "rating"]
}, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
# separate the records
json_response = simplejson.loads(json_query)
@@ -104,7 +108,7 @@ class Main:
if playcount > 0:
count = count - 1
continue
- title = item['label']
+ title = item['title']
rating = str(round(float(item['rating']),1))
year = str(item['year'])
plot = item['plot']
@@ -128,7 +132,7 @@ class Main:
def _fetch_episode_info( self ):
# query the database
tvshowid = 2
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetEpisodes", "params": { "properties": ["playcount", "season",
"episode", "showtitle", "plot", "fanart", "thumbnail", "file", "rating"] },
"id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetEpisodes", "params": { "properties": ["title", "playcount",
"season", "episode", "showtitle", "plot", "fanart", "thumbnail", "file",
"rating"] }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
# separate the records
json_response = simplejson.loads(json_query)
@@ -153,7 +157,7 @@ class Main:
if playcount > 0:
count = count - 1
continue
- title = item['label']
+ title = item['title']
showtitle = item['showtitle']
season = "%.2d" % float(item['season'])
episode = "%.2d" % float(item['episode'])
@@ -178,7 +182,7 @@ class Main:
def _fetch_musicvideo_info( self ):
# query the database
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMusicVideos", "params": {"properties": ["artist", "playcount",
"year", "plot", "runtime", "fanart", "thumbnail", "file"] }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMusicVideos", "params": {"properties": ["title", "artist",
"playcount", "year", "plot", "runtime", "fanart", "thumbnail", "file"] }, "id":
1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
# separate the records
json_response = simplejson.loads(json_query)
@@ -203,7 +207,7 @@ class Main:
if playcount > 0:
count = count - 1
continue
- title = item['label']
+ title = item['title']
year = str(item['year'])
plot = item['plot']
runtime = item['runtime']
@@ -224,7 +228,7 @@ class Main:
def _fetch_album_info( self ):
# query the database
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbums", "params": {"properties": ["artist", "year",
"thumbnail", "fanart", "rating"] }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbums", "params": {"properties": ["title", "artist", "year",
"thumbnail", "fanart", "rating"] }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
# separate the records
json_response = simplejson.loads(json_query)
@@ -244,7 +248,7 @@ class Main:
# remove the item from our list
json_response.remove( item )
# find values
- title = item['label']
+ title = item['title']
rating = str(item['rating'])
if rating == '48':
rating = ""
@@ -265,7 +269,7 @@ class Main:
def _fetch_song_info( self ):
# query the database
- json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["playcount", "artist",
"album", "year", "file", "thumbnail", "fanart", "rating"] }, "id": 1}')
+ json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["title", "playcount",
"artist", "album", "year", "file", "thumbnail", "fanart", "rating"] }, "id":
1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
# separate the records
json_response = simplejson.loads(json_query)
@@ -290,7 +294,7 @@ class Main:
if playcount > 0:
count = count - 1
continue
- title = item['label']
+ title = item['title']
rating = str(int(item['rating'])-48)
year = str(item['year'])
artist = item['artist']
diff --git a/script.randomitems/addon.xml b/script.randomitems/addon.xml
index dcbb2f7..c002082 100644
--- a/script.randomitems/addon.xml
+++ b/script.randomitems/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.randomitems" name="Random Items script" version="3.0.7"
provider-name="Hitcher, ronie">
+<addon id="script.randomitems" name="Random Items script" version="3.0.9"
provider-name="Hitcher, ronie">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.elementtree" version="1.2.7"/>
diff --git a/script.randomitems/changelog.txt b/script.randomitems/changelog.txt
index 26684e1..ab958cd 100644
--- a/script.randomitems/changelog.txt
+++ b/script.randomitems/changelog.txt
@@ -1,3 +1,9 @@
+v3.0.9
+- use title instead of label
+
+v3.0.8
+- use json when python 2.7 is available
+
v3.0.7
- ignore possible encoding errors
-----------------------------------------------------------------------
Summary of changes:
script.randomitems/RandomItems.py | 28 ++++++++++++++++------------
script.randomitems/addon.xml | 2 +-
script.randomitems/changelog.txt | 6 ++++++
3 files changed, 23 insertions(+), 13 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