Yes, its right, this solve my problem.
But i insert this in my script to let me get at least the unwatched episodes of a tvshow in a playlist
def _unWatchedEpisodes(self):
log("playlist insert")
playlist = xbmc.PlayList(1)
playlist.clear()
tvshowid = int(self.UNWATCHEDEPISODES)
json_filter = '"filter":{"field": "playcount", "operator": "is", "value": "0"}'
json_params = '"params": {"sort": {"order": "ascending", "method": "episode"},"properties": ["episode", "season", "playcount","file"], "tvshowid":%s,%s }' % (tvshowid,json_filter)
json_request = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes",%s , "id": 1}'% json_params)
json_request = unicode(json_request, 'utf-8', errors='ignore')
json_response = simplejson.loads(json_request)
if json_response.has_key('result') and json_response['result'] != None and json_response['result'].has_key('episodes'):
for episodesList in json_response['result']['episodes']:
#if episodesList.has_key('playcount'):
playcount = int(episodesList['playcount'])
if playcount==0:
file = episodesList['file']
fileReplace = file.replace("\\","/")
episodeid = int(episodesList['episodeid'])
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Playlist.Add","params":{"playlistid":1, "item": {"episodeid": %d}}}'%episodeid)
#playlist.add(url=file)
Since my functions (in CAV) are asynchronous i cant use a "loop" to insert the files in the playlist, i will get a out of order episodes, the only way to solve that is use a setTimeout, its a waist of time.
So now i can use smartplaylist with Vox or call my script to fill the playlist with the episodes.
Thanks for your help.
Clayton