mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 17:22:56 -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
|
@ -812,16 +812,20 @@ class Libraries(object):
|
|||
# If there is no library data we must return something
|
||||
return default_return
|
||||
|
||||
def get_watch_time_stats(self, section_id=None, grouping=None):
|
||||
def get_watch_time_stats(self, section_id=None, grouping=None, time_queries=None):
|
||||
if not session.allow_session_library(section_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]
|
||||
library_watch_time_stats = []
|
||||
|
||||
group_by = 'session_history.reference_id' if grouping else 'session_history.id'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue