From 8c324bdbb42692b691ad20734383ccae76809d8b Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Mon, 18 May 2020 18:25:45 +0200 Subject: [PATCH] Fix Trakt --- core/support.py | 1 + platformcode/xbmc_videolibrary.py | 10 ++++------ specials/videolibrary.py | 9 ++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/support.py b/core/support.py index 8796027e..392d532d 100755 --- a/core/support.py +++ b/core/support.py @@ -1139,6 +1139,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru videoitem.thumbnail = item.thumbnail videoitem.channel = item.channel videoitem.contentType = item.contentType + videoitem.infoLabels = item.infoLabels verifiedItemlist.append(videoitem) if patronTag: diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index e95cd582..270a0316 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -83,11 +83,10 @@ def mark_auto_as_watched(item): time.sleep(30) # Sincronizacion silenciosa con Trakt - if sync_with_trakt: - if config.get_setting("sync_trakt_watched", "videolibrary"): - sync_trakt_kodi() + if sync_with_trakt and config.get_setting("trakt_sync"): + sync_trakt_kodi() - # logger.debug("Fin del hilo") + # logger.debug("Fin del hilo") # Si esta configurado para marcar como visto if config.get_setting("mark_as_watched", "videolibrary"): @@ -455,8 +454,7 @@ def get_data(payload): except: xbmc_port = 0 - xbmc_json_rpc_url = "http://" + config.get_setting("xbmc_host", "videolibrary") + ":" + str( - xbmc_port) + "/jsonrpc" + xbmc_json_rpc_url = "http://" + config.get_setting("xbmc_host", "videolibrary") + ":" + str(xbmc_port) + "/jsonrpc" req = urllib.request.Request(xbmc_json_rpc_url, data=jsontools.dump(payload), headers=headers) f = urllib.request.urlopen(req) response = f.read() diff --git a/specials/videolibrary.py b/specials/videolibrary.py index 33d0bea1..347ff570 100644 --- a/specials/videolibrary.py +++ b/specials/videolibrary.py @@ -923,7 +923,6 @@ def verify_playcount_series(item, path): def mark_content_as_watched2(item): logger.info() # logger.debug("item:\n" + item.tostring('\n')) - if filetools.isfile(item.nfo): head_nfo, it = videolibrarytools.read_nfo(item.nfo) #logger.debug(it) @@ -935,7 +934,7 @@ def mark_content_as_watched2(item): it.library_playcounts.update({name_file: item.playcount}) if item.contentType == 'episode' or item.contentType == 'tvshow' or item.contentType == 'list' or name_file == 'tvshow': - # elif item.contentType == 'episode': + # elif item.contentType == 'episode': name_file = os.path.splitext(filetools.basename(item.strm_path))[0] num_season = name_file [0] item.__setattr__('contentType', 'episode') @@ -958,7 +957,7 @@ def mark_content_as_watched2(item): # Guardamos los cambios en item.nfo if filetools.write(item.nfo, head_nfo + it.tojson()): item.infoLabels['playcount'] = item.playcount - #logger.debug(item.playcount) + # logger.debug(item.playcount) # if item.contentType == 'episodesss': # Actualizar toda la serie @@ -968,9 +967,9 @@ def mark_content_as_watched2(item): if config.is_xbmc(): from platformcode import xbmc_videolibrary xbmc_videolibrary.mark_content_as_watched_on_kodi(item , item.playcount) - # logger.debug(item) + # logger.debug(item) - platformtools.itemlist_refresh() + # platformtools.itemlist_refresh() def mark_content_as_watched(item):