Example #1
0
	def check(self):
		scrobbleMinViewTimeOption = get_float_setting("scrobble_min_view_time")

		Debug("[Scrobbler] watched: %s / %s" % (str(self.watchedTime), str(self.totalTime)))
		if ((self.watchedTime / self.totalTime) * 100) >= scrobbleMinViewTimeOption:
			self.scrobble()
		else:
			self.stoppedWatching()
Example #2
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'])