def menu(): """First menu shown when add-on menu is requested""" if checkSettings() == False: return options = (_(201), watchlist_menu), (_(202), recommendation_menu), (_(203), trending_menu), (_(204), sync_clean_menu) _generate_menu(_(200), options)
def autostart(): if checkSettings(True): getTraktSettings() # startup notifcation service NotificationService() Debug("Plugin shutting down.")
def autostart(): """Run when xbmc stars up, runs tv or movie sync and cleans based on user settings""" if utilities.checkSettings(True): notification_thread = ns.NotificationService() notification_thread.start() autosync_movies = __settings__.getSetting("autosync_movies") autosync_tv = __settings__.getSetting("autosync_tv") autosync_cleanmoviecollection = __settings__.getSetting("autosync_cleanmovies") autosync_cleantvshowcollection = __settings__.getSetting("autosync_cleantv") try: if autosync_movies == "true": utilities.notification(_(200), _(110)) # start sync movies su.sync_movies(daemon=True) if autosync_cleanmoviecollection == "true": su.clean_movies(daemon=True) if xbmc.abortRequested: raise SystemExit() if autosync_tv == "true": utilities.notification(_(200), _(111)) # start tvshow collection update su.sync_tv(daemon=True) if autosync_cleantvshowcollection: su.clean_tv(daemon=True) if xbmc.abortRequested: raise SystemExit() if autosync_tv == "true" or autosync_movies == "true": utilities.notification(_(200), _(112)) # update / sync done except SystemExit: notification_thread.abort_requested = True Debug("[Service] Auto sync processes aborted due to shutdown request") notification_thread.join()
def autostart(): if checkSettings(True): notificationThread = NotificationService() notificationThread.start() notificationThread.join()