mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-14 01:02:59 -07:00
Added restart and shutdown links in settings.
No longer exposing passwords in html forms. Removed some old headphones js. Minor styling adjustments. Current activity on home screen now works. Some history table fixes and additions. Info screen for video items now works.
This commit is contained in:
parent
7dbaf46408
commit
04b290173c
16 changed files with 1163 additions and 257 deletions
|
@ -26,6 +26,7 @@ import re
|
|||
import os
|
||||
import json
|
||||
import xmltodict
|
||||
import math
|
||||
|
||||
|
||||
def multikeysort(items, columns):
|
||||
|
@ -111,6 +112,12 @@ def convert_milliseconds(ms):
|
|||
|
||||
return minutes
|
||||
|
||||
def convert_milliseconds_to_minutes(ms):
|
||||
|
||||
seconds = float(ms) / 1000
|
||||
minutes = round(seconds / 60, 0)
|
||||
|
||||
return math.trunc(minutes)
|
||||
|
||||
def convert_seconds(s):
|
||||
|
||||
|
@ -336,4 +343,16 @@ def convert_xml_to_json(xml):
|
|||
|
||||
def convert_xml_to_dict(xml):
|
||||
o = xmltodict.parse(xml)
|
||||
return o
|
||||
return o
|
||||
|
||||
|
||||
def get_percent(value1, value2):
|
||||
value1 = cast_to_float(value1)
|
||||
value2 = cast_to_float(value2)
|
||||
|
||||
if value1 != 0 and value2 != 0:
|
||||
percent = (value1 / value2) * 100
|
||||
else:
|
||||
percent = 0
|
||||
|
||||
return math.trunc(percent)
|
Loading…
Add table
Add a link
Reference in a new issue