summaryrefslogtreecommitdiffstats
path: root/abs/core/supplemental-web/contents/count.py
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/supplemental-web/contents/count.py')
-rw-r--r--abs/core/supplemental-web/contents/count.py11
1 files changed, 7 insertions, 4 deletions
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])