From e71718a047d89f69c186864a3bf3148b5c8db1aa Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 23 Dec 2020 17:56:08 +0100 Subject: [PATCH] Altri Fix alla riproduzione --- channels/la7.py | 4 ++-- channels/mediasetplay.py | 3 ++- channels/raiplay.py | 2 +- platformcode/platformtools.py | 12 ++++++++---- platformcode/xbmc_videolibrary.py | 4 ++-- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/channels/la7.py b/channels/la7.py index 16f7c3c2..9c3700ac 100644 --- a/channels/la7.py +++ b/channels/la7.py @@ -34,8 +34,8 @@ def mainlist(item): def live(item): - itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='play', forcethumb = True), - item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='play', forcethumb = True)] + itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='play', forcethumb = True, no_return=True), + item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='play', forcethumb = True, no_return=True)] return support.thumb(itemlist, live=True) diff --git a/channels/mediasetplay.py b/channels/mediasetplay.py index 3220d082..fa345558 100644 --- a/channels/mediasetplay.py +++ b/channels/mediasetplay.py @@ -96,7 +96,8 @@ def live(item): forcethumb = True, urls=urls, plot=plot, - action='play')) + action='play', + no_return=True)) return support.thumb(itemlist, live=True) def peliculas(item): diff --git a/channels/raiplay.py b/channels/raiplay.py index d8e7cba8..22eb9b87 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -168,7 +168,7 @@ def live(item): channel = key['channel'] itemlist.append(item.clone(title = support.typo(channel, 'bold'), fulltitle = channel, show = channel, url = key['video']['contentUrl'], thumbnail = key['transparent-icon'].replace("[RESOLUTION]", "256x-"), forcethumb = True , fanart = info[channel]['fanart'], - plot = info[channel]['plot'], action = 'play')) + plot = info[channel]['plot'], action = 'play', no_return=True)) return support.thumb(itemlist, live=True) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 9ac807b8..adb71daf 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -1036,15 +1036,19 @@ def set_player(item, xlistitem, mediaurl, view, strm): logger.info("mediaurl=" + mediaurl) if player_mode in [0,1]: - if player_mode in [1]: prevent_busy(item) - logger.info('Player Mode:' + ['Direct', 'Bookmark'][player_mode]) + prevent_busy(item) + if player_mode in [1]: + item.played_time = resume_playback(get_played_time(item)) + item.options['continue'] = True + + logger.info('Player Mode:',['Direct', 'Bookmark'][player_mode]) # Add the listitem to a playlist playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) playlist.clear() playlist.add(mediaurl, xlistitem) # Reproduce xbmc_player.play(playlist, xlistitem) - # viewed(item, played_time) + if config.get_setting('trakt_sync'): from core import trakt_tools trakt_tools.wait_for_update_trakt() @@ -1067,7 +1071,7 @@ def set_player(item, xlistitem, mediaurl, view, strm): # if it is a video library file send to mark as seen if strm or item.strm_path: item.options['strm'] = True - if player_mode == 1: item.options['continue'] = True + # if player_mode == 1: item.options['continue'] = True from platformcode import xbmc_videolibrary xbmc_videolibrary.mark_auto_as_watched(item) diff --git a/platformcode/xbmc_videolibrary.py b/platformcode/xbmc_videolibrary.py index 92ec039e..12eae9e3 100644 --- a/platformcode/xbmc_videolibrary.py +++ b/platformcode/xbmc_videolibrary.py @@ -26,7 +26,7 @@ def mark_auto_as_watched(item): 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)) + # 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: @@ -91,7 +91,7 @@ def mark_auto_as_watched(item): while platformtools.is_playing(): xbmc.sleep(100) - if not show_server and item.play_from != 'window': + if not show_server and item.play_from != 'window' and not item.no_return: xbmc.sleep(700) xbmc.executebuiltin('Action(Back)') xbmc.sleep(500)