Ejemplo n.º 1
0
    def _handle_bookmark(self):
        if g.get_runtime_setting("marked_watched_dialog_open"):
            return

        try:
            g.clear_kodi_bookmarks()
        except Exception:
            g.log_stacktrace()
            pass

        if self.current_time == 0 or self.total_time == 0:
            self.bookmark_sync.remove_bookmark(self.trakt_id)
            return

        if (
                self.watched_percentage < self.playCountMinimumPercent
                and self.current_time >= self.ignoreSecondsAtStart
                and not self._force_marked_watched
         ):
            self.bookmark_sync.set_bookmark(
                self.trakt_id,
                int(self.current_time),
                self.mediatype,
                self.watched_percentage,
                )
        else:
            self.bookmark_sync.remove_bookmark(self.trakt_id)
Ejemplo n.º 2
0
g.log("### PLATFORM: {}".format(g.PLATFORM))
g.log("### SQLite: {}".format(sqlite3.sqlite_version))  # pylint: disable=no-member
g.log("### Detected Kodi Version: {}".format(g.KODI_VERSION))
g.log("### Detected timezone: {}".format(repr(g.LOCAL_TIMEZONE.zone)))
g.log("#############  SERVICE ENTERED KEEP ALIVE  #################")

monitor = SerenMonitor()
try:
    xbmc.executebuiltin(
        'RunPlugin("plugin://plugin.video.seren/?action=longLifeServiceManager")'
    )

    do_update_news()
    validate_timezone_detected()
    try:
        g.clear_kodi_bookmarks()
    except TypeError:
        g.log(
            "Unable to clear bookmarks on service init. This is not a problem if it occurs immediately after install.",
            "warning")

    # Disable the restoration of reuselanguageinvoker addon.xml based on settings value on upgrade.
    # It can still be toggled in settings although initially it will show user's last setting value
    # This is in preparation for removal of user setting/toggle.
    # maintenance.toggle_reuselanguageinvoker(
    #     True if g.get_setting("reuselanguageinvoker.status") == "Enabled" else False)

    g.wait_for_abort(
        30)  # Sleep for a half a minute to allow widget loads to complete.
    while not monitor.abortRequested():
        xbmc.executebuiltin(