def start(): player = myPlayer() from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() if OLDVERSION != VERSION: #_zattooDB_.reloadDB(True) _zattooDB_.set_version(VERSION) import urllib #xbmc.executebuiltin('ActivateWindow(busydialognocancel)') #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() _zattooDB_.cleanProg(True) #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() _zattooDB_.updateChannels() #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() _zattooDB_.updateProgram() try: tomorrow = datetime.datetime.today() + datetime.timedelta(days=1) _zattooDB_.updateProgram(tomorrow) except: pass startTime = datetime.datetime.now() #-datetime.timedelta(minutes = 60) endTime = datetime.datetime.now() + datetime.timedelta(minutes=20) #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() #xbmcgui.Dialog().notification(localString(31916), localString(30110), __addon__.getAddonInfo('path') + '/icon.png', 3000, False) if __addon__.getSetting('dbonstart') == 'true': _zattooDB_.getProgInfo(True, startTime, endTime) recInfo() _library_.delete_library() # add by samoth _library_.make_library() #xbmcgui.Dialog().notification(localString(31106), localString(31915), __addon__.getAddonInfo('path') + '/icon.png', 3000, False) refreshProg()
def refreshProg(): import urllib monitor = xbmc.Monitor() while not monitor.abortRequested(): if monitor.waitForAbort(600): break from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() #update programInfo startTime = datetime.datetime.now() endTime = datetime.datetime.now() + datetime.timedelta(minutes=120) try: getProgNextDay() _zattooDB_.getProgInfo(False, startTime, endTime, 'all') except: pass
def start(): from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() # reload Account xbmcgui.Dialog().notification( localString(30104), localString(31024), __addon__.getAddonInfo('path') + '/resources/icon.png', 500, False) profilePath = xbmc.translatePath(__addon__.getAddonInfo('profile')) os.remove(os.path.join(profilePath, 'cookie.cache')) os.remove(os.path.join(profilePath, 'session.cache')) os.remove(os.path.join(profilePath, 'account.cache')) _zattooDB_.zapiSession() player = myPlayer() VERSION = __addon__.getAddonInfo('version') OLDVERSION = _zattooDB_.get_version(VERSION) if OLDVERSION != VERSION: # reload DB _zattooDB_.reloadDB() # set Version _zattooDB_.set_version(VERSION) import urllib #xbmc.executebuiltin('ActivateWindow(busydialognocancel)') #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() _zattooDB_.cleanProg(True) #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() _zattooDB_.updateChannels() #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() _zattooDB_.updateProgram() try: tomorrow = datetime.datetime.today() + datetime.timedelta(days=1) _zattooDB_.updateProgram(tomorrow) except: pass startTime = datetime.datetime.now() #-datetime.timedelta(minutes = 60) endTime = datetime.datetime.now() + datetime.timedelta(minutes=20) #re-import ZattooDB to prevent "convert_timestamp" error from resources.lib.zattooDB import ZattooDB _zattooDB_ = ZattooDB() #xbmcgui.Dialog().notification(localString(31916), localString(30110), __addon__.getAddonInfo('path') + '/icon.png', 3000, False) if __addon__.getSetting('dbonstart') == 'true': _zattooDB_.getProgInfo(True, startTime, endTime) recInfo() #xbmcgui.Dialog().notification(localString(31106), localString(31915), __addon__.getAddonInfo('path') + '/icon.png', 3000, False) refreshProg()