Skip to content

Commit

Permalink
Fix concurrent streams graph query
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Oct 11, 2023
1 parent d8d1f75 commit 7245e97
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions plexpy/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,13 +825,14 @@ def calc_most_concurrent(result):
return final_count

try:
query = 'SELECT sh.date_played, sh.started, sh.stopped, shmi.transcode_decision ' \
'FROM (SELECT *, ' \
'date(started, "unixepoch", "localtime") AS date_played ' \
'FROM session_history %s) AS sh ' \
'JOIN session_history_media_info AS shmi ON sh.id = shmi.id ' \
'WHERE sh.stopped >= %s ' \
'ORDER BY sh.date_played' % (user_cond, timestamp)
query = "SELECT sh.date_played, sh.started, sh.stopped, shmi.transcode_decision " \
"FROM (SELECT *, " \
"date(started, 'unixepoch', 'localtime') AS date_played " \
"FROM session_history %s " \
"GROUP BY id) AS sh " \
"JOIN session_history_media_info AS shmi ON sh.id = shmi.id " \
"WHERE sh.stopped >= %s " \
"ORDER BY sh.started" % (user_cond, timestamp)

result = monitor_db.select(query)
except Exception as e:
Expand Down

0 comments on commit 7245e97

Please sign in to comment.