def check(self): scrobbleMinViewTimeOption = utilities.getSettingAsFloat("scrobble_min_view_time") Debug("[Scrobbler] watched: %s / %s" % (str(self.watchedTime), str(self.videoDuration))) if ((self.watchedTime / self.videoDuration) * 100) >= scrobbleMinViewTimeOption: self.scrobble() else: self.stoppedWatching()
def ratingCheck(media_type, summary_info, watched_time, total_time, playlist_length): """Check if a video should be rated and if so launches the rating dialog""" utils.Debug("[Rating] Rating Check called for '%s'" % media_type) if not utils.getSettingAsBool("rate_%s" % media_type): utils.Debug("[Rating] '%s' is configured to not be rated." % media_type) return if summary_info is None: utils.Debug("[Rating] Summary information is empty, aborting.") return watched = (watched_time / total_time) * 100 if watched >= utils.getSettingAsFloat("rate_min_view_time"): if (playlist_length <= 1) or utils.getSettingAsBool("rate_each_playlist_item"): rateMedia(media_type, summary_info) else: utils.Debug("[Rating] Rate each playlist item is disabled.") else: utils.Debug( "[Rating] '%s' does not meet minimum view time for rating (watched: %0.2f%%, minimum: %0.2f%%)" % (media_type, watched, utils.getSettingAsFloat("rate_min_view_time")) )
def ratingCheck(media_type, summary_info, watched_time, total_time, playlist_length): """Check if a video should be rated and if so launches the rating dialog""" logger.debug("Rating Check called for '%s'" % media_type) if not utils.getSettingAsBool("rate_%s" % media_type): logger.debug("'%s' is configured to not be rated." % media_type) return if summary_info is None: logger.debug("Summary information is empty, aborting.") return watched = (watched_time / total_time) * 100 if watched >= utils.getSettingAsFloat("rate_min_view_time"): if (playlist_length <= 1) or utils.getSettingAsBool("rate_each_playlist_item"): rateMedia(media_type, summary_info) else: logger.debug("Rate each playlist item is disabled.") else: logger.debug( "'%s' does not meet minimum view time for rating (watched: %0.2f%%, minimum: %0.2f%%)" % (media_type, watched, utils.getSettingAsFloat("rate_min_view_time")))