The branch, eden has been updated
via eb30932966e97f84f276d91e5017f9758c64f4a9 (commit)
from 2efad295f63077542f6eccf6b8b7fdb11854f24a (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=eb30932966e97f84f276d91e5017f9758c64f4a9
commit eb30932966e97f84f276d91e5017f9758c64f4a9
Author: unknown <[email protected]>
Date: Wed Aug 8 12:55:30 2012 +0200
[script.watchlist] -v0.1.16
diff --git a/script.watchlist/addon.xml b/script.watchlist/addon.xml
index 670915e..98009ec 100644
--- a/script.watchlist/addon.xml
+++ b/script.watchlist/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="script.watchlist" name="Watchlist" version="0.1.15"
provider-name="ronie, `Black">
+<addon id="script.watchlist" name="Watchlist" version="0.1.16"
provider-name="ronie, `Black, Martijn">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/script.watchlist/changelog.txt b/script.watchlist/changelog.txt
index d118b65..0b4e328 100644
--- a/script.watchlist/changelog.txt
+++ b/script.watchlist/changelog.txt
@@ -1,3 +1,6 @@
+v0.1.16
+- fix error on empty JSON-RPC result
+
v0.1.15
- fixed up the case for TV episodes where you have more than 1 file for a
given season/episode of a TV show (thx jparyani)
diff --git a/script.watchlist/default.py b/script.watchlist/default.py
index 0d3b35d..3853b4f 100644
--- a/script.watchlist/default.py
+++ b/script.watchlist/default.py
@@ -76,7 +76,7 @@ class Main:
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetMovies", "params": {"properties": ["title", "resume", "genre",
"studio", "tagline", "runtime", "fanart", "thumbnail", "file", "plot",
"plotoutline", "year", "lastplayed", "rating"]}, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
- if json_response.has_key('result') and
json_response['result'].has_key('movies'):
+ if json_response.has_key('result') and json_response.has_key['result']
!= None and json_response['result'].has_key('movies'):
for item in json_response['result']['movies']:
self.movieList.append(item)
if item['resume']['position'] > 0:
@@ -114,7 +114,7 @@ class Main:
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetEpisodes", "params": {"properties": ["title", "playcount",
"plot", "season", "episode", "showtitle", "thumbnail", "file", "lastplayed",
"rating"], "sort": {"method": "episode"} }, "id": 1}' )
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
- if json_response.has_key('result') and
json_response['result'].has_key('episodes'):
+ if json_response.has_key('result') and json_response.has_key['result']
!= None and json_response['result'].has_key('episodes'):
json_response = json_response['result']['episodes']
# our list is sorted by episode number, secondary we sort by
tvshow title (itertools.groupy needs contiguous items) and split it into
seperate lists for each tvshow
episodes = [list(group) for key,group in
itertools.groupby(sorted(json_response, key=itemgetter('showtitle')),
key=itemgetter('showtitle'))]
@@ -136,7 +136,7 @@ class Main:
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"VideoLibrary.GetSeasons", "params": {"properties": ["season", "thumbnail"],
"tvshowid":%s }, "id": 1}' % tvshowid)
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
- if json_response.has_key('result') and
json_response['result'].has_key('seasons'):
+ if json_response.has_key('result') and json_response.has_key['result']
!= None and json_response['result'].has_key('seasons'):
for item in json_response['result']['seasons']:
season = "%.2d" % float(item['season'])
if season == seasonnumber:
@@ -213,7 +213,7 @@ class Main:
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetSongs", "params": {"properties": ["playcount", "albumid"],
"sort": { "method": "album" } }, "id": 1}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
- if json_response.has_key('result') and (json_response['result'] !=
None) and (json_response['result'].has_key('songs')):
+ if json_response.has_key('result') and json_response.has_key['result']
!= None and json_response['result'].has_key('songs'):
for item in json_response['result']['songs']:
albumid = item['albumid']
if albumid != '':
@@ -242,7 +242,7 @@ class Main:
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method":
"AudioLibrary.GetAlbumDetails", "params": {"properties": ["title",
"description", "albumlabel", "artist", "genre", "year", "thumbnail", "fanart",
"rating"], "albumid":%s }, "id": 1}' % albumid[0])
json_query = unicode(json_query, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_query)
- if json_response.has_key('result') and
json_response['result'].has_key('albumdetails'):
+ if json_response.has_key('result') and
json_response.has_key['result'] != None and
json_response['result'].has_key('albumdetails'):
item = json_response['result']['albumdetails']
description = item['description']
album = item['title']
@@ -269,7 +269,7 @@ class Main:
playlist = xbmc.PlayList(0)
# clear the playlist
playlist.clear()
- if json_response.has_key('result') and
json_response['result'].has_key('songs'):
+ if json_response.has_key('result') and json_response.has_key['result']
!= None and json_response['result'].has_key('songs'):
for item in json_response['result']['songs']:
song = item['file']
fanart = item['fanart']
-----------------------------------------------------------------------
Summary of changes:
script.watchlist/addon.xml | 2 +-
script.watchlist/changelog.txt | 3 +++
script.watchlist/default.py | 12 ++++++------
3 files changed, 10 insertions(+), 7 deletions(-)
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons