Fix Trakt

This commit is contained in:
Alhaziel01
2021-07-13 16:01:00 +02:00
parent ef0c1c1189
commit a8ac567792
3 changed files with 17 additions and 8 deletions
+9 -3
View File
@@ -1910,7 +1910,7 @@ def acciones_trakt(item):
post = None
if item.post: post = jsontools.dump(item.post)
url = "http://api-v2launch.trakt.tv/%s" % item.url
url = "http://api.trakt.tv/%s" % item.url
data = httptools.downloadpage(url, post=post, headers=headers)
if data.code == "401":
trakt_tools.token_trakt(item.clone(args="renew"))
@@ -1966,14 +1966,20 @@ def acciones_trakt(item):
# try: entry = entry[item.args]
# except: pass
new_item = item.clone(action="details")
if 'show' in entry or 'show' in item.args:
if 'show' in entry and 'show' in item.args:
entry = entry['show']
new_item.args = 'show'
new_item.contentType = 'tvshow'
else:
elif 'movie' in entry and 'movie' in item.args:
entry = entry['movie']
new_item.args = 'movie'
new_item.contentType = 'movie'
elif 'show' in item.args:
new_item.args = 'show'
new_item.contentType = 'tvshow'
else:
new_item.args = 'movie'
new_item.contentType = 'movie'
new_item.title = entry["title"] + " (%s)" % entry["year"]
new_item.infoLabels["tmdb_id"] = entry["ids"]["tmdb"]
try: ratings.append(entry["rating"])
+4 -1
View File
@@ -920,7 +920,8 @@ def mark_content_as_watched(item):
if config.is_xbmc():
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_content_as_watched_on_kodi(item, item.playcount)
if config.get_setting("trakt_sync"):
xbmc_videolibrary.sync_trakt_kodi()
platformtools.itemlist_refresh()
@@ -975,6 +976,8 @@ def mark_season_as_watched(item):
# We update the Kodi database
from platformcode import xbmc_videolibrary
xbmc_videolibrary.mark_season_as_watched_on_kodi(item, item.playcount)
if config.get_setting("trakt_sync"):
xbmc_videolibrary.sync_trakt_kodi()
platformtools.itemlist_refresh()