From e1e3754e2904b1abe2e1891cd3650a0ebcea65b2 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Thu, 29 Mar 2018 18:36:48 +0200 Subject: [PATCH] Remove read items from later and vice versa --- index.cgi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.cgi b/index.cgi index 946c784..a7f1232 100755 --- a/index.cgi +++ b/index.cgi @@ -74,6 +74,7 @@ sub redirect { print "Location: $item->{link}\n"; print "\n"; $dbh->do("insert into read(username, item_id) values(?, ?)", {}, $q->remote_user, $item_id); + $dbh->do("delete from later where username=? and item_id=?", {}, $q->remote_user, $item_id); $mcd->delete(item_info_key($q->remote_user, $item->{feed_id})); exit(0); } @@ -97,6 +98,7 @@ sub mark { print "Location: ", $q1->self_url, "\n"; print "\n"; $dbh->do("insert into read(username, item_id) values(?, ?)", {}, $q->remote_user, $item_id); + $dbh->do("delete from later where username=? and item_id=?", {}, $q->remote_user, $item_id); $mcd->delete(item_info_key($q->remote_user, $item->{feed_id})); print_log("mark done"); exit(0); @@ -122,6 +124,7 @@ sub mark_later { print "Location: ", $q1->self_url, "\n"; print "\n"; $dbh->do("insert into later(username, item_id) values(?, ?)", {}, $q->remote_user, $item_id); + $dbh->do("delete from read where username=? and item_id=?", {}, $q->remote_user, $item_id); $mcd->delete(item_info_key($q->remote_user, $item->{feed_id})); print_log("mark_later done"); exit(0);