Exemplo n.º 1
0
def markEpisodeDuringPlayback(imdb, tvdb, season, episode, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()

        if int(watched) == 7: trakt.markEpisodeAsWatched(tvdb, season, episode)
        else: trakt.markEpisodeAsNotWatched(tvdb, season, episode)
        trakt.cachesyncTVShows()

        if trakt.getTraktAddonEpisodeInfo() == True:
            trakt.markEpisodeAsNotWatched(tvdb, season, episode)
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('tvshow', name='', imdb_id=imdb)
        metaget.get_episode_meta('',
                                 imdb_id=imdb,
                                 season=season,
                                 episode=episode)
        metaget.change_watched('episode',
                               '',
                               imdb_id=imdb,
                               season=season,
                               episode=episode,
                               watched=int(watched))
    except:
        pass
Exemplo n.º 2
0
def markEpisodeDuringPlayback(imdb, tvdb, season, episode, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False:
            raise Exception()

        setting = None

        if int(watched) == 7:
            # Only mark as watched if the previous watch is more than a week ago.
            # Trakt allows to mark an item with multiple watches, eg: watching a movie multiple times.
            # However, if the playback is stopped at almost the end of the stream and then finished a few days later, it will be marked watched multiple times.
            # Ignore these marks for items watched more than a week ago.

            allow = True
            setting = tools.Settings.getInteger(
                'accounts.informants.trakt.watched')

            if setting == 0:
                try:
                    watchedTime = trakt.watchedShowsTime(tvdb, season, episode)
                    watchedTime = convert.ConverterTime(
                        value=watchedTime,
                        format=convert.ConverterTime.FormatDateTimeJson
                    ).timestamp()
                    currentTime = tools.Time.timestamp()
                    differenceTime = currentTime - watchedTime
                    allow = differenceTime > 604800
                except:
                    pass
            elif setting == 1:
                trakt.markEpisodeAsNotWatched(imdb, tvdb, season, episode)

            if allow: trakt.markEpisodeAsWatched(imdb, tvdb, season, episode)
        else:
            trakt.markEpisodeAsNotWatched(imdb, tvdb, season, episode)

        trakt.cachesyncTVShows()

        if (setting == None
                or setting == 1) and trakt.getTraktAddonEpisodeInfo() == True:
            trakt.markEpisodeAsNotWatched(imdb, tvdb, season, episode)
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('tvshow', name='', imdb_id=imdb)
        metaget.get_episode_meta('',
                                 imdb_id=imdb,
                                 season=season,
                                 episode=episode)
        metaget.change_watched('episode',
                               '',
                               imdb_id=imdb,
                               season=season,
                               episode=episode,
                               watched=int(watched))
    except:
        pass
Exemplo n.º 3
0
def markEpisodeDuringPlayback(imdb, tvdb, season, episode, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False:
            raise Exception()

        if int(watched) == 7:
            trakt.markEpisodeAsWatched(tvdb, season, episode)
        else:
            trakt.markEpisodeAsNotWatched(tvdb, season, episode)
        trakt.cachesyncTVShows()

        if trakt.getTraktAddonEpisodeInfo() == True:
            trakt.markEpisodeAsNotWatched(tvdb, season, episode)
    except:
        pass

    try:
        from metahandler import metahandlers

        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta("tvshow", name="", imdb_id=imdb)
        metaget.get_episode_meta("", imdb_id=imdb, season=season, episode=episode)
        metaget.change_watched("episode", "", imdb_id=imdb, season=season, episode=episode, watched=int(watched))
    except:
        pass
Exemplo n.º 4
0
def markEpisodeDuringPlayback(imdb, tmdb, season, episode, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()

        if int(watched) == 7: trakt.markEpisodeAsWatched(imdb, season, episode)
        else: trakt.markEpisodeAsNotWatched(imdb, season, episode)
        trakt.cachesyncTVShows()

        if trakt.getTraktAddonEpisodeInfo() == True:
            trakt.markEpisodeAsNotWatched(imdb, season, episode)
    except:
        pass

    try:
        if int(watched) == 7:
            bookmarks.reset(1, 1, 'episode', imdb, season, episode)
    except:
        pass
Exemplo n.º 5
0
def markEpisodeDuringPlayback(imdb, tvdb, season, episode, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()

        if int(watched) == 7: trakt.markEpisodeAsWatched(tvdb, season, episode)
        else: trakt.markEpisodeAsNotWatched(tvdb, season, episode)
        trakt.cachesyncTVShows()

        if trakt.getTraktAddonEpisodeInfo() == True:
            trakt.markEpisodeAsNotWatched(tvdb, season, episode)
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False, tmdb_api_key='f3248106719173ab34be38966164050d')
        metaget.get_meta('tvshow', name='', imdb_id=imdb)
        metaget.get_episode_meta('', imdb_id=imdb, season=season, episode=episode)
        metaget.change_watched('episode', '', imdb_id=imdb, season=season, episode=episode, watched=int(watched))
    except:
        pass