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:
Tim 2015-06-16 17:35:52 +02:00
parent 7dbaf46408
commit 04b290173c
16 changed files with 1163 additions and 257 deletions

View file

@ -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)