2013-10-01, 03:53
There seems to be a problem with special characters as i can't seem to remove "Carnivàle" from the programs to exclude.
(2013-10-01, 03:53)mtoddster Wrote: There seems to be a problem with special characters as i can't seem to remove "Carnivàle" from the programs to exclude.
(2013-09-28, 00:26)Karnagious Wrote: Yep, the change is all made. I have found the json-rpc is slower but it isnt 30 times slower.
Are you doing lots of queries or just one for all the data and then having the script crunch the numbers?
Care to share the code?
def show_root_menu():
''' Show the plugin root menu. '''
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "properties": ["file","fanart","thumbnail","art","season"], "sort": { "order": "ascending", "method": "label" } }, "id": "libTvShows"}')
json_query = unicode(json_query, 'utf-8', errors='ignore')
jsonobject = simplejson.loads(json_query)
if jsonobject.has_key('result') and jsonobject['result'].has_key('tvshows'):
tvshows = jsonobject['result']['tvshows']
for tvshow in tvshows:
#addDirectoryItem(name="Show "+tvshow['label'], url='videodb://2/2/'+str(tvshow['tvshowid']), isFolder=True,icon=tvshow['thumbnail'])
# Search for season information
json_query_season = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetSeasons", "params": {"properties": ["season", "watchedepisodes","episode","showtitle","thumbnail","fanart"], "sort": { "method": "label" }, "tvshowid":%s }, "id": 1}' %tvshow['tvshowid'])
jsonobject_season = simplejson.loads(json_query_season)
if jsonobject_season['result'].has_key('seasons'):
seasons = jsonobject_season['result']['seasons']
for season in seasons:
string='??'
if season['episode']!=season['watchedepisodes'] and season['watchedepisodes']!=0:
string='['+str(season['watchedepisodes'])+'/'+str(season['episode'])+']'
addDirectoryItem(name=season['showtitle']+' - '+xbmc.getLocalizedString(20358)%season['season']+' '+string,
url='videodb://2/2/'+str(tvshow['tvshowid'])+'/'+str(season['season']),isFolder=True,
icon=season['thumbnail'],fanart=season['fanart'])
xbmcplugin.addSortMethod( handle=handle, sortMethod=xbmcplugin.SORT_METHOD_TITLE,label2Mask="X%s" )
xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
def show_root_menu():
''' Show the plugin root menu. '''
conn=sqlite.connect(xbmc.translatePath('special://database/MyVideos75.db'))
c=conn.cursor()
c.execute("SELECT tvshow.c00 as name,tvshow.[idShow] as idshow, episode.c12 as season,"+
" NULLIF(COUNT(episode.c12), 0) AS totalCount, COUNT(nullif(files.playCount,0)) AS watchedcount, ifnull(poster.url,''), ifnull(fanart.url,'')"+
" FROM tvshow"+
" LEFT JOIN episode ON episode.idShow=tvshow.idShow"+
" LEFT JOIN files ON files.idFile=episode.idFile"+
" left join seasons on seasons.[idShow]=tvshow.idShow and seasons.season=episode.c12"+
" left join art poster on seasons.idSeason=poster.media_id and poster.media_type='season'"+
" left join art as fanart on tvshow.idShow=fanart.media_id and fanart.type='fanart'"+
" group by name,tvshow.idshow,episode.c12"+
" having (totalcount<>watchedcount and watchedcount<>0)")
row=c.fetchone()
while row is not None:
addDirectoryItem(name=row[0]+' - '+xbmc.getLocalizedString(20358)%int(row[2])+' '+'['+str(row[4])+'/'+str(row[3])+']',
url='videodb://2/2/'+str(row[1])+'/'+str(row[2]),isFolder=True,icon=row[5],fanart=row[6])
row=c.fetchone()
conn.close()
xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
(2013-10-02, 15:31)Karnagious Wrote: - changed the addon.xml so LazyTV will show up in Video AddonsI will test this out and let you know how it works for me.
- launching the shows in the player with the episode ID, which will hopefully mean that watched streams will be changed to 'watched' in the database
(2013-10-08, 23:34)Karnagious Wrote: Thanks Patrick. Let me know how you get on with using the addon.
I will be releasing the new version to the official repo in a couple days. Before that you can get it at the Github link. I have updated the Master Branch there so it has all my recent changes.
Someone has told me that they added LazyTV to autoexec.py so that it runs when XBMC is started. I have started looking at having that as an option in the Settings.