KoD 1.5.1

- corretta e migliorata la nuova ricerca globale\n- salvataggio punto di visione basato sull'id tmdb (disponibile su qualunque canale / server anche senza salvare in videoteca)\n- alcuni fix e migliore\n
This commit is contained in:
marco
2020-12-17 18:41:54 +01:00
parent 23e61f23c6
commit de5a65d77a
130 changed files with 853 additions and 553 deletions
+23 -17
View File
@@ -20,15 +20,19 @@ from core import scrapertools
from xml.dom import minidom
def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
def mark_as_watched_subThread(item, nfo_path, head_nfo, item_nfo):
def mark_auto_as_watched(item):
def mark_as_watched_subThread(item):
logger.debug()
actual_time = 0
total_time = 0
# logger.debug("item:\n" + item.tostring('\n'))
if item.options['continue']: item.played_time = platformtools.resume_playback(platformtools.get_played_time(item))
time_limit = time.time() + 30
while not platformtools.is_playing() and time.time() < time_limit:
time.sleep(1)
marked = False
next_episode = None
show_server = True
@@ -39,14 +43,15 @@ def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
next_dialogs = ['NextDialog.xml', 'NextDialogExtended.xml', 'NextDialogCompact.xml']
next_ep_type = config.get_setting('next_ep_type')
ND = next_dialogs[next_ep_type]
next_episode = next_ep(item)
try: next_episode = next_ep(item)
except: next_episode = False
while platformtools.is_playing():
actual_time = xbmc.Player().getTime()
total_time = xbmc.Player().getTotalTime()
if item_nfo.played_time and xbmcgui.getCurrentWindowId() == 12005:
xbmc.Player().seekTime(item_nfo.played_time)
item_nfo.played_time = 0 # Fix for Slow Devices
if item.played_time and xbmcgui.getCurrentWindowId() == 12005:
xbmc.Player().seekTime(item.played_time)
item.played_time = 0 # Fix for Slow Devices
mark_time = total_time * percentage
difference = total_time - actual_time
@@ -55,7 +60,7 @@ def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
if actual_time > mark_time and not marked:
logger.info("Marked as Watched")
item.playcount = 1
marked = True
if item.options['strm'] : marked = True
show_server = False
from specials import videolibrary
videolibrary.mark_content_as_watched2(item)
@@ -75,9 +80,11 @@ def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
break
xbmc.sleep(1000)
# Set played time
item_nfo.played_time = int(actual_time) if not marked else 0
filetools.write(nfo_path, head_nfo + item_nfo.tojson())
if item.options['continue']:
if 120 < actual_time < (total_time / 100) * 80:
item.played_time = actual_time
else: item.played_time = 0
platformtools.set_played_time(item)
# Silent sync with Trakt
if marked and config.get_setting("trakt_sync"): sync_trakt_kodi()
@@ -94,7 +101,7 @@ def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
# If it is configured to mark as seen
if config.get_setting("mark_as_watched", "videolibrary"):
threading.Thread(target=mark_as_watched_subThread, args=[item, nfo_path, head_nfo, item_nfo]).start()
threading.Thread(target=mark_as_watched_subThread, args=[item]).start()
@@ -1340,12 +1347,11 @@ class NextDialog(xbmcgui.WindowXMLDialog):
f.close()
full_info = "".join(full_info)
info = jsontools.load(full_info)
if "thumbnail" in info:
img = info["thumbnail"]
else:
img = filetools.join(config.get_runtime_path(), "resources", "noimage.png")
self.setProperty("next_img", img)
info = info["infoLabels"]
if "fanart" in info: img = info["fanart"]
elif "thumbnail" in info: img = info["thumbnail"]
else: img = filetools.join(config.get_runtime_path(), "resources", "noimage.png")
self.setProperty("next_img", img)
self.setProperty("title", info["tvshowtitle"])
self.setProperty("ep_title", "%dx%02d - %s" % (info["season"], info["episode"], info["title"]))
@@ -1381,4 +1387,4 @@ class NextDialog(xbmcgui.WindowXMLDialog):
if action in self.action_exitkeys_id:
self.set_exit(True)
self.set_continue_watching(False)
self.close()
self.close()