diff options
author | Britney Fransen <brfransen@gmail.com> | 2023-01-13 21:04:38 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2023-01-13 21:04:38 (GMT) |
commit | b455d5f7fb70b2d7350e7b9aff8ff6d4ada73818 (patch) | |
tree | 278b7a518c62bef94b2b672ef86045f1599090f1 /linhes/linhes-web/website | |
parent | df1f008a48180c3d2cf45b29c934dc793bb15580 (diff) | |
download | linhes_pkgbuild-b455d5f7fb70b2d7350e7b9aff8ff6d4ada73818.zip linhes_pkgbuild-b455d5f7fb70b2d7350e7b9aff8ff6d4ada73818.tar.gz linhes_pkgbuild-b455d5f7fb70b2d7350e7b9aff8ff6d4ada73818.tar.bz2 |
linhes-web: fix count.py for empty db
Diffstat (limited to 'linhes/linhes-web/website')
-rw-r--r-- | linhes/linhes-web/website/contents/count.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/linhes/linhes-web/website/contents/count.py b/linhes/linhes-web/website/contents/count.py index d5f3259..2aaa3e1 100644 --- a/linhes/linhes-web/website/contents/count.py +++ b/linhes/linhes-web/website/contents/count.py @@ -9,11 +9,8 @@ import socket def main(argv): #get LinHES version - verfile = open('/etc/os-release', 'r') - for line in verfile: - if line.startswith('PRETTY_NAME'): - verLHlist = line.split('"') - verLH = verLHlist[1] + verfile = open('/etc/LinHES-release', 'r') + verLH = verfile.read() verfile.close() grandtotal=0 @@ -34,8 +31,10 @@ def main(argv): grandtotal+=total hours = grandtotal / 60.0 days = hours / 24.0 - - cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM recorded where not (recgroup=(%s)) ORDER by starttime",("LiveTV")) + try: + cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM recorded where not (recgroup=(%s)) ORDER by starttime",("LiveTV")) + except: + pass result_current = cursor.fetchall() for row in result_current: start=row[0] |