from resources.lib.downloadutils import DownloadUtils from resources.lib.simple_logging import SimpleLogging from resources.lib.play_utils import Service, PlaybackService, sendProgress from resources.lib.kodi_utils import HomeWindow from resources.lib.widgets import checkForNewContent, set_background_image from resources.lib.websocket_client import WebSocketClient from resources.lib.menu_functions import set_library_window_values # clear user and token when logging in home_window = HomeWindow() home_window.clearProperty("userid") home_window.clearProperty("AccessToken") home_window.clearProperty("Params") log = SimpleLogging('service') download_utils = DownloadUtils() # auth the service try: download_utils.authenticate() download_utils.getUserId() except Exception as error: log.error("Error with initial service auth: {0}", error) # set up all the services monitor = Service() playback_service = PlaybackService(monitor) home_window = HomeWindow() last_progress_update = time.time() last_content_check = time.time()
home_window.clearProperty("Params") log = SimpleLogging('service') monitor = xbmc.Monitor() # wait for 10 seconds for the Kodi splash screen to close i = 0 while not monitor.abortRequested(): if i == 100 or not xbmc.getCondVisibility("Window.IsVisible(startup)"): break i += 1 xbmc.sleep(100) checkServer() download_utils = DownloadUtils() # auth the service try: download_utils.authenticate() download_utils.getUserId() except Exception as error: log.error("Error with initial service auth: {0}", error) # set up all the services monitor = Service() playback_service = PlaybackService(monitor) home_window = HomeWindow() last_progress_update = time.time() last_content_check = time.time()
try: clear_old_cache_data() except Exception as error: log.error("Error in clear_old_cache_data() : {0}".format(error)) # wait for 10 seconds for the Kodi splash screen to close i = 0 while not monitor.abortRequested(): if i == 100 or not xbmc.getCondVisibility("Window.IsVisible(startup)"): break i += 1 xbmc.sleep(100) check_server() download_utils = DownloadUtils() # auth the service try: download_utils.authenticate() download_utils.get_user_id() except Exception as error: log.error("Error with initial service auth: {0}".format(error)) image_server = HttpImageServerThread() image_server.start() # set up all the services monitor = Service() playback_service = PlaybackService(monitor)