Fix home stats Last Watched to use watched percent specified in settings

This commit is contained in:
Jonathan Wong 2015-09-16 01:13:08 -07:00
parent 048b31c87a
commit 7170dbd800
3 changed files with 23 additions and 8 deletions

View file

@ -69,6 +69,7 @@ class WebInterface(object):
"home_stats_type": plexpy.CONFIG.HOME_STATS_TYPE,
"home_stats_count": plexpy.CONFIG.HOME_STATS_COUNT,
"pms_identifier": plexpy.CONFIG.PMS_IDENTIFIER,
"notify_watched_percent": plexpy.CONFIG.NOTIFY_WATCHED_PERCENT
}
return serve_template(templatename="index.html", title="Home", config=config)
@ -121,9 +122,12 @@ class WebInterface(object):
return json.dumps(formats)
@cherrypy.expose
def home_stats(self, time_range='30', stat_type='0', stat_count='5', **kwargs):
def home_stats(self, time_range='30', stat_type='0', stat_count='5', notify_watched_percent='85', **kwargs):
data_factory = datafactory.DataFactory()
stats_data = data_factory.get_home_stats(time_range=time_range, stat_type=stat_type, stat_count=stat_count)
stats_data = data_factory.get_home_stats(time_range=time_range,
stat_type=stat_type,
stat_count=stat_count,
notify_watched_percent=notify_watched_percent)
return serve_template(templatename="home_stats.html", title="Stats", data=stats_data)