def run(argv):
    # Initialize globals right away to avoid stale values from the last addon invocation.
    # Otherwise Kodi's reuseLanguageInvoker will cause some really quirky behavior!
    # PR: https://github.com/xbmc/xbmc/pull/13814
    g.init_globals(argv)
    check_service_upgrade()
    NetflixService().run()
예제 #2
0
    def run(self):
        """Main loop. Runs until xbmc.Monitor requests abort"""
        # pylint: disable=broad-except
        try:
            self.start_services()
        except Exception as exc:
            ui.show_addon_error_info(exc)
            return

        while not self.controller.abortRequested():
            if self._tick_and_wait_for_abort():
                break
        self.shutdown()

    def _tick_and_wait_for_abort(self):
        # pylint: disable=broad-except
        try:
            self.controller.on_playback_tick()
            self.library_updater.on_tick()
        except Exception as exc:
            common.error(traceback.format_exc())
            ui.show_notification(': '.join(
                (exc.__class__.__name__, exc.message)))
        return self.controller.waitForAbort(1)


if __name__ == '__main__':
    upgrade_ctrl.check_service_upgrade()
    NetflixService().run()