diff --git a/service.py b/service.py index d68b84b..eb964f9 100644 --- a/service.py +++ b/service.py @@ -11,7 +11,7 @@ import xbmcgui from resources.lib.lazylogger import LazyLogger from resources.lib.play_utils import Service, PlaybackService, send_progress from resources.lib.kodi_utils import HomeWindow -from resources.lib.widgets import set_background_image, set_random_movies +from resources.lib.widgets import set_background_image, set_random_movies, set_random_tvshows from resources.lib.websocket_client import WebSocketClient from resources.lib.menu_functions import set_library_window_values from resources.lib.server_detect import check_server, check_connection_speed @@ -20,7 +20,6 @@ from resources.lib.datamanager import clear_old_cache_data from resources.lib.tracking import set_timing_enabled from resources.lib.image_server import HttpImageServerThread from resources.lib.playnext import PlayNextService -from resources.lib.intro_skipper import IntroSkipperService settings = xbmcaddon.Addon() @@ -64,6 +63,7 @@ last_progress_update = time.time() last_content_check = time.time() last_background_update = 0 last_random_movie_update = 0 +last_random_tvshow_update = 0 # start the library update monitor library_change_monitor = LibraryChangeMonitor() @@ -88,10 +88,6 @@ if context_menu: context_monitor = ContextMonitor() context_monitor.start() -# Start the skip service monitor -intro_skipper = IntroSkipperService(monitor) -intro_skipper.start() - background_interval = int(settings.getSetting('background_interval')) newcontent_interval = int(settings.getSetting('new_content_check_interval')) random_movie_list_interval = int(settings.getSetting('random_movie_refresh_interval')) @@ -109,6 +105,7 @@ first_run = True home_window.set_property('exit', 'False') while home_window.get_property('exit') == 'False': + try: if xbmc.Player().isPlaying(): last_random_movie_update = time.time() - (random_movie_list_interval - 15) @@ -142,8 +139,12 @@ while home_window.get_property('exit') == 'False': settings.setSetting("server_speed_check_data", server_host + "-skipped") if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_movie_update) > random_movie_list_interval): - last_random_movie_update = time.time() - set_random_movies() + last_random_movie_update = time.time() + set_random_movies() + + if user_changed or (random_movie_list_interval != 0 and (time.time() - last_random_tvshow_update) > random_movie_list_interval): + last_random_tvshow_update = time.time() + set_random_tvshows() if user_changed or (newcontent_interval != 0 and (time.time() - last_content_check) > newcontent_interval): last_content_check = time.time() @@ -187,9 +188,6 @@ if play_next_service: # call stop on the context menu monitor if context_monitor: context_monitor.stop_monitor() - -if intro_skipper: - intro_skipper.stop_service() # clear user and token when logging off home_window.clear_property("user_name")