Пример #1
0
def ratingCheck(current_video, watched_time, total_time, playlist_length):
	"""Check if a video should be rated and if so launches the rating dialog"""
	Debug("[Rating] Rating Check called for '%s' with id=%s" % (current_video['type'], str(current_video['id'])));
	if get_bool_setting("rate_%s" % current_video['type']):
		watched = (watched_time / total_time) * 100
		if watched >= get_float_setting("rate_min_view_time"):
			if (playlist_length <= 1) or get_bool_setting("rate_each_playlist_item"):
				rateMedia(current_video['id'], current_video['type'])
			else:
				Debug("[Rating] Rate each playlist item is disabled.")
		else:
			Debug("[Rating] '%s' does not meet minimum view time for rating (watched: %0.2f%%, minimum: %0.2f%%)" % (current_video['type'], watched, get_float_setting("rate_min_view_time")))
	else:
		Debug("[Rating] '%s' is configured to not be rated." % current_video['type'])
Пример #2
0
# -*- coding: utf-8 -*-

import xbmc
import xbmcgui
import xbmcaddon
from utilities import xbmcJsonRequest, Debug, notification, chunks, get_bool_setting

__setting__   = xbmcaddon.Addon('script.trakt').getSetting
__getstring__ = xbmcaddon.Addon('script.trakt').getLocalizedString

add_episodes_to_trakt = get_bool_setting('add_episodes_to_trakt')
trakt_episode_playcount = get_bool_setting('trakt_episode_playcount')
xbmc_episode_playcount = get_bool_setting('xbmc_episode_playcount')
clean_trakt_episodes = get_bool_setting('clean_trakt_episodes')

progress = xbmcgui.DialogProgress()

def compare_show(xbmc_show, trakt_show):
	missing = []
	trakt_seasons = [x['season'] for x in trakt_show['seasons']]

	for xbmc_episode in xbmc_show['episodes']:
		if xbmc_episode['season'] not in trakt_seasons:
			missing.append(xbmc_episode)
		else:
			for trakt_season in trakt_show['seasons']:
				if xbmc_episode['season'] == trakt_season['season']:
					if xbmc_episode['episode'] not in trakt_season['episodes']:
						missing.append(xbmc_episode)

	return missing
Пример #3
0
# -*- coding: utf-8 -*-

import xbmc
import xbmcgui
import xbmcaddon
from utilities import xbmcJsonRequest, Debug, notification, chunks, get_bool_setting

__setting__   = xbmcaddon.Addon('script.trakt').getSetting
__getstring__ = xbmcaddon.Addon('script.trakt').getLocalizedString

add_movies_to_trakt = get_bool_setting('add_movies_to_trakt')
trakt_movie_playcount = get_bool_setting('trakt_movie_playcount')
xbmc_movie_playcount = get_bool_setting('xbmc_movie_playcount')
clean_trakt_movies = get_bool_setting('clean_trakt_movies')

progress = xbmcgui.DialogProgress()

def xbmc_to_trakt_movie(movie, playcount=False):
	""" Helper to convert XBMC movie into a format trakt can use. """

	trakt_movie = {'title': movie['title'], 'year': movie['year']}

	if movie['imdbnumber'].startswith('tt'): #IMDB
		trakt_movie['imdb_id'] = movie['imdbnumber']

	elif movie['imdbnumber'].isdigit(): #TVDB
		trakt_movie['tmdb_id'] = movie['imdbnumber']

	if playcount:
		trakt_movie['plays'] = movie['playcount']
# -*- coding: utf-8 -*-

import xbmc
import xbmcgui
import xbmcaddon
from utilities import xbmcJsonRequest, Debug, notification, chunks, get_bool_setting

__setting__   = xbmcaddon.Addon('script.myshows').getSetting
__getstring__ = xbmcaddon.Addon('script.myshows').getLocalizedString

add_episodes_to_myshows = get_bool_setting('add_episodes_to_myshows')
myshows_episode_playcount = get_bool_setting('myshows_episode_playcount')
xbmc_episode_playcount = get_bool_setting('xbmc_episode_playcount')
clean_myshows_episodes = get_bool_setting('clean_myshows_episodes')

progress = xbmcgui.DialogProgress()

def compare_show(xbmc_show, myshows_show):
	missing = []
	myshows_seasons = [x['season'] for x in myshows_show['seasons']]

	for xbmc_episode in xbmc_show['episodes']:
		if xbmc_episode['season'] not in myshows_seasons:
			missing.append(xbmc_episode)
		else:
			for myshows_season in myshows_show['seasons']:
				if xbmc_episode['season'] == myshows_season['season']:
					if xbmc_episode['episode'] not in myshows_season['episodes']:
						missing.append(xbmc_episode)

	return missing