mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Fix watched status to use watched percent specified in settings
This commit is contained in:
parent
adc808ac9f
commit
626e7fdf82
3 changed files with 15 additions and 6 deletions
|
@ -26,7 +26,7 @@ class DataFactory(object):
|
|||
def __init__(self):
|
||||
pass
|
||||
|
||||
def get_history(self, kwargs=None, custom_where=None, grouping=0):
|
||||
def get_history(self, kwargs=None, custom_where=None, grouping=0, watched_percent=85):
|
||||
data_tables = datatables.DataTables()
|
||||
|
||||
group_by = ['session_history.reference_id'] if grouping else ['session_history.id']
|
||||
|
@ -95,6 +95,13 @@ class DataFactory(object):
|
|||
else:
|
||||
thumb = item["thumb"]
|
||||
|
||||
if item['percent_complete'] >= watched_percent:
|
||||
watched_status = 1
|
||||
elif item['percent_complete'] >= watched_percent/2:
|
||||
watched_status = 0.5
|
||||
else:
|
||||
watched_status = 0
|
||||
|
||||
row = {"reference_id": item["reference_id"],
|
||||
"id": item["id"],
|
||||
"date": item["date"],
|
||||
|
@ -118,7 +125,7 @@ class DataFactory(object):
|
|||
"parent_media_index": item["parent_media_index"],
|
||||
"thumb": thumb,
|
||||
"video_decision": item["video_decision"],
|
||||
"percent_complete": item["percent_complete"],
|
||||
"watched_status": watched_status,
|
||||
"group_count": item["group_count"]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue