summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-03-01 18:30:58 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2016-03-01 18:30:58 +0100
commit95140b880b035f07f4545c8421230c25349b45e4 (patch)
treecbb61dd982ea1a6ea0345011925ab6381ae6e6b6 /scripts
parent6ec4a3589e327ded693ab0c741828fc5ec66b840 (diff)
parent42f5c405c0280b6216028d0513e29c306e388426 (diff)
downloadaurweb-95140b880b035f07f4545c8421230c25349b45e4.tar.xz
Merge branch 'maint'
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/popupdate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/popupdate.py b/scripts/popupdate.py
index 2aa8a54..f3ba513 100755
--- a/scripts/popupdate.py
+++ b/scripts/popupdate.py
@@ -22,7 +22,7 @@ cur.execute("UPDATE PackageBases SET NumVotes = (SELECT COUNT(*) FROM " +
"PackageVotes WHERE PackageVotes.PackageBaseID = PackageBases.ID)")
cur.execute("UPDATE PackageBases SET Popularity = (" +
- "SELECT SUM(POWER(0.98, (UNIX_TIMESTAMP() - VoteTS) / 86400)) " +
+ "SELECT COALESCE(SUM(POWER(0.98, (UNIX_TIMESTAMP() - VoteTS) / 86400)), 0.0) " +
"FROM PackageVotes WHERE PackageVotes.PackageBaseID = " +
"PackageBases.ID AND NOT VoteTS IS NULL)")