mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 17:22:56 -07:00
Clean up watch statistics duration database queries
This commit is contained in:
parent
7b9210a5fc
commit
92a868c3c6
2 changed files with 60 additions and 63 deletions
|
@ -51,16 +51,17 @@ DOCUMENTATION :: END
|
|||
from plexpy import helpers
|
||||
|
||||
# Human readable duration
|
||||
def hd(minutes):
|
||||
if int(minutes) > 60:
|
||||
hours = int(helpers.cast_to_float(minutes) / 60)
|
||||
minutes = int(helpers.cast_to_float(minutes) % 60 )
|
||||
def hd(seconds):
|
||||
minutes = helpers.cast_to_float(seconds) / 60
|
||||
if minutes > 60:
|
||||
hours = int(minutes / 60)
|
||||
minutes = int(minutes % 60)
|
||||
if minutes > 0:
|
||||
return "<h3>" + str(hours) + "</h3><p>hrs</p><h3>" + str(minutes) + "</h3><p>mins</p>"
|
||||
else:
|
||||
return "<h3>" + str(hours) + "</h3><p>hrs</p>"
|
||||
else:
|
||||
return "<h3>" + minutes + "</h3><p>mins</p>"
|
||||
return "<h3>" + str(int(minutes)) + "</h3><p>mins</p>"
|
||||
%>
|
||||
|
||||
% if data:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue