mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -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
|
@ -810,7 +810,7 @@ class WebInterface(object):
|
|||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_library_watch_time_stats(self, section_id=None, grouping=None, **kwargs):
|
||||
def get_library_watch_time_stats(self, section_id=None, grouping=None, time_queries=None, **kwargs):
|
||||
""" Get a library's watch time statistics.
|
||||
|
||||
```
|
||||
|
@ -819,6 +819,7 @@ class WebInterface(object):
|
|||
|
||||
Optional parameters:
|
||||
grouping (int): 0 or 1
|
||||
time_queries (str): "1, 7, 30, 0"
|
||||
|
||||
Returns:
|
||||
json:
|
||||
|
@ -845,7 +846,8 @@ class WebInterface(object):
|
|||
|
||||
if section_id:
|
||||
library_data = libraries.Libraries()
|
||||
result = library_data.get_watch_time_stats(section_id=section_id, grouping=grouping)
|
||||
result = library_data.get_watch_time_stats(section_id=section_id, grouping=grouping,
|
||||
time_queries=time_queries)
|
||||
if result:
|
||||
return result
|
||||
else:
|
||||
|
@ -1427,7 +1429,7 @@ class WebInterface(object):
|
|||
@cherrypy.tools.json_out()
|
||||
@requireAuth(member_of("admin"))
|
||||
@addtoapi()
|
||||
def get_user_watch_time_stats(self, user_id=None, grouping=None, **kwargs):
|
||||
def get_user_watch_time_stats(self, user_id=None, grouping=None, time_queries=None, **kwargs):
|
||||
""" Get a user's watch time statistics.
|
||||
|
||||
```
|
||||
|
@ -1436,6 +1438,7 @@ class WebInterface(object):
|
|||
|
||||
Optional parameters:
|
||||
grouping (int): 0 or 1
|
||||
time_queries (str): "1, 7, 30, 0"
|
||||
|
||||
Returns:
|
||||
json:
|
||||
|
@ -1462,7 +1465,7 @@ class WebInterface(object):
|
|||
|
||||
if user_id:
|
||||
user_data = users.Users()
|
||||
result = user_data.get_watch_time_stats(user_id=user_id, grouping=grouping)
|
||||
result = user_data.get_watch_time_stats(user_id=user_id, grouping=grouping, time_queries=time_queries)
|
||||
if result:
|
||||
return result
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue