@@ 21,14 21,18 @@ if {[catch {sqlite3 db $dbpath -create false}]} {
fatal "can't open \"$dbpath\""
}
-set unplayed [db eval {SELECT name,href FROM titles WHERE played ISNULL AND ignore = 0}]
+set unplayed [db eval {SELECT name,href,comment FROM titles WHERE played ISNULL AND ignore = 0}]
set chan [::tcl::chan::random [::tcl::randomseed]]
binary scan [read $chan 4] i1 n
-set idx [expr { (abs($n) % ([llength $unplayed] / 2)) * 2 }]
+set idx [expr { (abs($n) % ([llength $unplayed] / 3)) * 3 }]
set name [lindex $unplayed $idx]
set href [lindex $unplayed $idx+1]
+set comment [lindex $unplayed $idx+2]
puts "Random pick: $name"
-puts "- $href"
+puts "- link: $href"
+if {$comment != ""} {
+ puts "- comment: $comment"
+}