diff options
author | James Meyer <james.meyer@operamail.com> | 2011-12-29 20:09:01 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2011-12-29 20:09:01 (GMT) |
commit | 5752c2147ae11aa7bf72c54c74d1393543cbcc7b (patch) | |
tree | 7da1746da785ddb43657cd3784de1fd0fa96ace2 /abs/core | |
parent | 1dd5961670bc8ea7c1e6618d39070a5b5aa8b7af (diff) | |
download | linhes_pkgbuild-5752c2147ae11aa7bf72c54c74d1393543cbcc7b.zip linhes_pkgbuild-5752c2147ae11aa7bf72c54c74d1393543cbcc7b.tar.gz linhes_pkgbuild-5752c2147ae11aa7bf72c54c74d1393543cbcc7b.tar.bz2 |
supplemental-web: correct count.py to remove live-tv from the stats. Set all blank categories to "Unkown"
refs #806
Diffstat (limited to 'abs/core')
-rw-r--r-- | abs/core/supplemental-web/PKGBUILD | 2 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/count.py | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index 8fcd23b..af2f600 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,6 +1,6 @@ pkgname=supplemental-web pkgver=1.0 -pkgrel=14 +pkgrel=15 arch=('i686') MVDIR=$startdir/pkg/usr/MythVantage install=supplemental-web.install diff --git a/abs/core/supplemental-web/contents/count.py b/abs/core/supplemental-web/contents/count.py index 6d813c1..d59144a 100644 --- a/abs/core/supplemental-web/contents/count.py +++ b/abs/core/supplemental-web/contents/count.py @@ -14,7 +14,7 @@ def main(argv): # create a cursor cursor = db.cursor() # execute SQL statement - cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM oldrecorded ORDER by starttime;") + cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM oldrecorded where oldrecorded.recstatus = -3 ORDER by starttime;") result = cursor.fetchall() for row in result: @@ -58,7 +58,7 @@ def main(argv): print '<div id="content"> <p></p>' print '<table class="sample">' print "Top 20 Shows" - cursor.execute("select title,count(title),category as numtitle from oldrecorded group by title having (COUNT(title) > 1) order by (COUNT(title)) DESC limit 20;" ) + cursor.execute("select title,count(title),category as numtitle from oldrecorded where oldrecorded.recstatus = -3 group by title having (COUNT(title) > 0 ) order by (COUNT(title)) DESC limit 20;" ) result = cursor.fetchall() for row in result: print " <tr>" @@ -74,11 +74,14 @@ def main(argv): print '<div id="column"></div>' print '<table class="sample">' print "Top 20 Categories" - cursor.execute("select category,count(category) as numtitle from oldrecorded group by category having (COUNT(category) > 1) order by (COUNT(category)) DESC limit 20; " ) + cursor.execute("select category,count(category) as numtitle from oldrecorded where oldrecorded.recstatus = -3 group by category having (COUNT(category) > 0 ) order by (COUNT(category)) DESC limit 20; " ) result = cursor.fetchall() for row in result: + category = row[0] + if category == "": + category = "Unknown" print " <tr>" - print " <td>",row[0],"</td>" + print " <td>",category,"</td>" print " <td>",row[1],"</td>" print " </tr>" #print "%16s %16s" %(row[0],row[1]) |