diff --git a/core/support.py b/core/support.py index 392d532d..2eb085d9 100755 --- a/core/support.py +++ b/core/support.py @@ -507,6 +507,10 @@ def scrape(func): # itemlist = filterLang(item, itemlist) # causa problemi a newest + if config.get_setting('trakt_sync'): + from core import trakt_tools + trakt_tools.trakt_check(itemlist) + return itemlist return wrapper diff --git a/core/trakt_tools.py b/core/trakt_tools.py index 743e5fbb..ad24130e 100644 --- a/core/trakt_tools.py +++ b/core/trakt_tools.py @@ -199,7 +199,7 @@ def trakt_check(itemlist): from core.support import typo id_result = '' # check = u'\u221a' - check = typo(u'\u221a','[] color kod bold')+' ' + check = typo(u'\u221a','color kod bold')+' ' synced = False try: for item in itemlist: @@ -247,7 +247,7 @@ def trakt_check(itemlist): def get_sync_from_file(): logger.info() - sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt') + sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt_data.json') trakt_node = {} if os.path.exists(sync_path): trakt_node = jsontools.get_node_from_file('trakt', "TRAKT") @@ -260,7 +260,7 @@ def get_sync_from_file(): def update_trakt_data(mediatype, trakt_data): logger.info() - sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt') + sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt_data.json') if os.path.exists(sync_path): trakt_node = jsontools.get_node_from_file('trakt', "TRAKT") trakt_node[mediatype] = trakt_data @@ -289,6 +289,7 @@ def wait_for_update_trakt(): t.isAlive() def update_all(): + # from core.support import dbg;dbg() from time import sleep logger.info() sleep(20) diff --git a/service.py b/service.py index 99ef0f57..de18c897 100644 --- a/service.py +++ b/service.py @@ -256,6 +256,10 @@ def check_for_update(overwrite=True): item_dummy = Item() videolibrary.list_movies(item_dummy, silent=True) + if config.get_setting('trakt_sync'): + from core import trakt_tools + trakt_tools.update_all() + def viewmodeMonitor(): try: