def update_files(self): from entertainment import istream as entertainment entertainment.loadiStreamPlugins(load_fileformats=True) ff_objs = {} file_details = self.get_files_with_details() for file_detail in file_details: ff_obj = ff_objs.get(file_detail['format'], None) if not ff_obj: ff_obj = entertainment.GetFileFormatObj(file_detail['format']) if not ff_obj: continue ff_obj.AddItem(file_detail, file_detail['title'], file_detail['name'], file_detail['parents'])
from entertainment import istream as entertainment from entertainment import common import os entertainment.loadiStreamPlugins(load_settings=True) #SUBSCRIPTIONS AUTO UPDATE service_py = 'updatesubscriptions.py' default_subs_auto_update_sleep_duration = 30 common.addon.log('Subscription Auto Update Service - Starting\\Waking...') auto_update_subs = entertainment.GetiStreamSettings( common.settings_XBMC_Integration, 'auto_update_subscriptions') if auto_update_subs == 'true': import datetime common.addon.log('Subscription Auto Update Service - Auto Update Enabled') subs_last_update = entertainment.GetiStreamSettings( common.settings_XBMC_Integration, 'update_suscription_timestamp') if subs_last_update == '' or not subs_last_update: subs_last_update = datetime.datetime.today().strftime( '%Y-%m-%d %H:%M:%S') entertainment.SetiStreamSettings(common.settings_XBMC_Integration, 'update_suscription_timestamp', subs_last_update) try: subs_last_update_dt = datetime.datetime.strptime( subs_last_update, "%Y-%m-%d %H:%M:%S") except: import time subs_last_update_dt = datetime.datetime( *(time.strptime(subs_last_update, "%Y-%m-%d %H:%M:%S")[0:6]))
from entertainment import istream as entertainment from entertainment import common import os entertainment.loadiStreamPlugins(load_settings=True) #SUBSCRIPTIONS AUTO UPDATE service_py = 'updatesubscriptions.py' default_subs_auto_update_sleep_duration = 30 common.addon.log('Subscription Auto Update Service - Starting\\Waking...') auto_update_subs = entertainment.GetiStreamSettings(common.settings_XBMC_Integration, 'auto_update_subscriptions') if auto_update_subs == 'true': import datetime common.addon.log('Subscription Auto Update Service - Auto Update Enabled') subs_last_update = entertainment.GetiStreamSettings(common.settings_XBMC_Integration, 'update_suscription_timestamp') if subs_last_update == '' or not subs_last_update: subs_last_update = datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S') entertainment.SetiStreamSettings(common.settings_XBMC_Integration, 'update_suscription_timestamp', subs_last_update) try: subs_last_update_dt = datetime.datetime.strptime(subs_last_update, "%Y-%m-%d %H:%M:%S") except: import time subs_last_update_dt = datetime.datetime(*(time.strptime(subs_last_update, "%Y-%m-%d %H:%M:%S")[0:6])) curr_dt = datetime.datetime.today() time_diff = curr_dt - subs_last_update_dt auto_update_interval = datetime.timedelta ( hours = int(entertainment.GetiStreamSettings(common.settings_XBMC_Integration, 'auto_update_interval')))