mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Allow custom time_queries for get_watch_stats
This commit is contained in:
parent
16ffbd9940
commit
d1f1763919
4 changed files with 21 additions and 8 deletions
|
@ -434,16 +434,20 @@ class Users(object):
|
|||
# Use "Local" user to retain compatibility with PlexWatch database value
|
||||
return default_return
|
||||
|
||||
def get_watch_time_stats(self, user_id=None, grouping=None):
|
||||
def get_watch_time_stats(self, user_id=None, grouping=None, time_queries=None):
|
||||
if not session.allow_session_user(user_id):
|
||||
return []
|
||||
|
||||
if grouping is None:
|
||||
grouping = plexpy.CONFIG.GROUP_HISTORY_TABLES
|
||||
|
||||
if time_queries is not None:
|
||||
time_queries = map(int, time_queries.split(","))
|
||||
else:
|
||||
time_queries = [1, 7, 30, 0]
|
||||
|
||||
monitor_db = database.MonitorDatabase()
|
||||
|
||||
time_queries = [1, 7, 30, 0]
|
||||
user_watch_time_stats = []
|
||||
|
||||
group_by = 'reference_id' if grouping else 'id'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue