コード例 #1
0
def markMovieDuringPlayback(imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() is False:
            raise Exception()

        if int(watched) == 7:
            trakt.markMovieAsWatched(imdb)
        else:
            trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()

        if trakt.getTraktAddonMovieInfo() is True:
            trakt.markMovieAsNotWatched(imdb)
    except Exception:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('movie', name='', imdb_id=imdb)
        metaget.change_watched('movie',
                               name='',
                               imdb_id=imdb,
                               watched=int(watched))
    except Exception:
        pass
コード例 #2
0
def movies(imdb, watched):
    control.busy()
    try:
        if trakt.getTraktIndicatorsInfo() is False:
            raise Exception()
        if int(watched) == 7:
            trakt.markMovieAsWatched(imdb)
        else:
            trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()
        control.refresh()
    except Exception:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('movie', name='', imdb_id=imdb)
        metaget.change_watched('movie',
                               name='',
                               imdb_id=imdb,
                               watched=int(watched))
        if trakt.getTraktIndicatorsInfo() is False:
            control.refresh()
    except Exception:
        pass
コード例 #3
0
def markMovieDuringPlayback(imdb, watched):
	try:
		if traktIndicators is False:
			raise Exception()

		if int(watched) == 7:
			trakt.markMovieAsWatched(imdb)
		else:
			trakt.markMovieAsNotWatched(imdb)

		trakt.cachesyncMovies()

		# if trakt.getTraktAddonMovieInfo() is True:
			# log_utils.log('trakt.getTraktAddonMovieInfo = True', __name__, log_utils.LOGDEBUG)
			# trakt.markMovieAsNotWatched(imdb)
	except:
		pass

	try:
		from metahandler import metahandlers
		metaget = metahandlers.MetaData()
		metaget.get_meta('movie', name='', imdb_id=imdb)
		metaget.change_watched('movie', name='', imdb_id=imdb, watched=int(watched))
	except:
		pass
コード例 #4
0
ファイル: playcount.py プロジェクト: gaiaorigin/gaiasource
def markMovieDuringPlayback(imdb, tmdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False:
            raise Exception()

        setting = None

        watched = int(watched)
        watchedIs = watched == 7
        if watchedIs:
            # 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.watchedMoviesTime(imdb)
                    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.markMovieAsNotWatched(imdb=imdb, tmdb=tmdb)

            if allow: trakt.markMovieAsWatched(imdb=imdb, tmdb=tmdb)
        else:
            trakt.markMovieAsNotWatched(imdb=imdb, tmdb=tmdb)

        trakt.syncMoviesCache()

        if (setting == None
                or setting == 1) and trakt.getTraktAddonMovieInfo() == True:
            trakt.markMovieAsNotWatched(imdb)
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('movie', name='', imdb_id=imdb)
        metaget.change_watched('movie', name='', imdb_id=imdb, watched=watched)
    except:
        pass

    try:
        from resources.lib.extensions import video
        if watchedIs: video.Trailer().watch(imdb=imdb)
        else: video.Trailer().unwatch(imdb=imdb)
    except:
        tools.Logger.error()
コード例 #5
0
def markMovieDuringPlayback(imdb, watched):
	try:
		if traktIndicators:
			if int(watched) == 7: trakt.markMovieAsWatched(imdb)
			else: trakt.markMovieAsNotWatched(imdb)
			trakt.cachesyncMovies()
			# if trakt.getTraktAddonMovieInfo():
				# trakt.markMovieAsNotWatched(imdb)
		else:
			from metahandler import metahandlers
			metaget = metahandlers.MetaData()
			metaget.get_meta('movie', name='', imdb_id=imdb)
			metaget.change_watched('movie', name='', imdb_id=imdb, watched=int(watched))
	except:
		log_utils.error()
コード例 #6
0
def markMovieDuringPlayback(imdb, watched):
	try:
		if traktIndicators:
			if int(watched) == 5: trakt.markMovieAsWatched(imdb)
			else: trakt.markMovieAsNotWatched(imdb)
			trakt.cachesyncMovies()
			# if trakt.getTraktAddonMovieInfo():
				# trakt.markMovieAsNotWatched(imdb)
		else:
			check_metahandler()
			metaget = metahandlers.MetaData(tmdb_api_key, omdb_api_key, tvdb_api_key)
			metaget.get_meta('movie', name='', imdb_id=imdb)
			metaget.change_watched('movie', name='', imdb_id=imdb, watched=int(watched))
	except:
		from resources.lib.modules import log_utils
		log_utils.error()
コード例 #7
0
def movies(imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()
        if int(watched) == 7: trakt.markMovieAsWatched(imdb)
        else: trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()
        control.refresh()
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('movie', name='', imdb_id=imdb)
        metaget.change_watched('movie', name='', imdb_id=imdb, watched=int(watched))
        if trakt.getTraktIndicatorsInfo() == False: control.refresh()
    except:
        pass
コード例 #8
0
def markMovieDuringPlayback(imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()

        if int(watched) == 7: trakt.markMovieAsWatched(imdb)
        else: trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()

        if trakt.getTraktAddonMovieInfo() == True:
            trakt.markMovieAsNotWatched(imdb)
    except:
        pass

    try:
        if int(watched) == 7:
            bookmarks.reset(1, 1, 'movie', imdb, '', '')
    except:
        pass
コード例 #9
0
ファイル: playcount.py プロジェクト: varunrai/Masterani-Redux
def markMovieDuringPlayback(imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()

        if int(watched) == 7: trakt.markMovieAsWatched(imdb)
        else: trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()

        if trakt.getTraktAddonMovieInfo() == True:
            trakt.markMovieAsNotWatched(imdb)
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False, tmdb_api_key='f3248106719173ab34be38966164050d')
        metaget.get_meta('movie', name='', imdb_id=imdb)
        metaget.change_watched('movie', name='', imdb_id=imdb, watched=int(watched))
    except:
        pass
コード例 #10
0
def movies(imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()
        if int(watched) == 7: trakt.markMovieAsWatched(imdb)
        else: trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()
        control.refresh()
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(
            preparezip=False, tmdb_api_key='f3248106719173ab34be38966164050d')
        metaget.get_meta('movie', name='', imdb_id=imdb)
        metaget.change_watched('movie',
                               name='',
                               imdb_id=imdb,
                               watched=int(watched))
        if trakt.getTraktIndicatorsInfo() == False: control.refresh()
    except:
        pass
コード例 #11
0
def movies(imdb, watched):
    #    control.busy()
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()
        if int(watched) == 7: trakt.markMovieAsWatched(imdb)
        else: trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()
        control.refresh()
#        control.idle()
    except:
        pass

    try:
        if int(watched) == 7:
            bookmarks.reset(1, 1, 'movie', imdb, '', '')
        else:
            bookmarks._delete_record('movie', imdb, '', '')
        if trakt.getTraktIndicatorsInfo() == False: control.refresh()


#        control.idle()
    except:
        pass
コード例 #12
0
def movies(title, year, imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False: raise Exception()
        if int(watched) == 7: trakt.markMovieAsWatched(imdb)
        else: trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()
        control.refresh()
    except:
        pass

    try:
        from metahandler import metahandlers
        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta('movie', title, year=year)
        metaget.change_watched('movie',
                               '',
                               imdb,
                               season='',
                               episode='',
                               year='',
                               watched=watched)
        if trakt.getTraktIndicatorsInfo() == False: control.refresh()
    except:
        pass
コード例 #13
0
def markMovieDuringPlayback(imdb, watched):
    try:
        if trakt.getTraktIndicatorsInfo() == False:
            raise Exception()

        if int(watched) == 7:
            trakt.markMovieAsWatched(imdb)
        else:
            trakt.markMovieAsNotWatched(imdb)
        trakt.cachesyncMovies()

        if trakt.getTraktAddonMovieInfo() == True:
            trakt.markMovieAsNotWatched(imdb)
    except:
        pass

    try:
        from metahandler import metahandlers

        metaget = metahandlers.MetaData(preparezip=False)
        metaget.get_meta("movie", name="", imdb_id=imdb)
        metaget.change_watched("movie", name="", imdb_id=imdb, watched=int(watched))
    except:
        pass