def update_library(): now = time.time() is_syncing = plugin.getProperty('openmeta_syncing_library') is_updating = plugin.getProperty('openmeta_updating_library') if is_syncing and now - int(is_syncing) < 120: plugin.log.debug('Skipping library sync') else: if plugin.get_setting('library_sync_collection', bool) == True: try: plugin.setProperty('openmeta_syncing_library', int(now)) plugin.notify('OpenMeta', 'Syncing library', plugin.get_addon_icon(), 1000) lib_tvshows.sync_trakt_collection() lib_movies.sync_trakt_collection() finally: plugin.clearProperty('openmeta_syncing_library') if is_updating and now - int(is_updating) < 120: plugin.log.debug('Skipping library update') return else: if plugin.get_setting('library_updates', bool) == True: try: plugin.setProperty('openmeta_updating_library', int(now)) plugin.notify('OpenMeta', 'Updating library', plugin.get_addon_icon(), 1000) lib_tvshows.update_library() finally: plugin.clearProperty('openmeta_updating_library')
def update_library_from_settings(): now = time.time() if plugin.yesno('OpenMeta', 'Would you like to update the library now?'): try: plugin.setProperty('openmeta_updating_library', int(now)) plugin.notify('OpenMeta', 'Updating library', plugin.get_addon_icon(), 500) lib_tvshows.update_library() finally: plugin.clearProperty('openmeta_updating_library')
def silent_setup(): plugin.setProperty('totalopenmeta', 'true') movielibraryfolder = plugin.get_setting('movies_library_folder', unicode) tvlibraryfolder = plugin.get_setting('tv_library_folder', unicode) try: lib_movies.auto_movie_setup(movielibraryfolder) lib_tvshows.auto_tvshows_setup(tvlibraryfolder) except: pass plugin.clearProperty('totalopenmeta')
def players_setup(): plugin.setProperty('openmeta_players_setup', 'true') url = plugin.get_setting('players_update_url', unicode) if url == '': if plugin.yesno('OpenMeta players setup', 'Would you like to set a URL for players now?'): plugin.open_settings() else: plugin.notify('OpenMeta players setup', 'Failed', plugin.get_addon_icon(), 3000) elif updater.update_players(url): plugin.notify('OpenMeta players setup', 'Done', plugin.get_addon_icon(), 3000) else: plugin.notify('OpenMeta players setup', 'Failed', plugin.get_addon_icon(), 3000) plugin.clearProperty('openmeta_players_setup') return True
def onPlayBackStopped(self): plugin.clearProperty('script.trakt.ids') plugin.clearProperty('plugin.video.chappaai.data') if self.totalTime > 0 and self.currentTime / self.totalTime >= 0.75: self.mark_as_watched() self.reset()
def onPlayBackEnded(self): plugin.clearProperty('script.trakt.ids') plugin.clearProperty('plugin.video.KodiTVR_VIDEO_PLAYER.data') if self.totalTime > 0 and self.currentTime / self.totalTime >= 0.75: self.mark_as_watched() self.reset()