From 8376cc9cb9dd8128025b13bb6d2305bfe8f097d5 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Mon, 1 May 2017 18:29:07 -0400 Subject: [PATCH] Mark articles as unread when they are updated --- lib/Database.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Database.php b/lib/Database.php index b811fa2..194465e 100644 --- a/lib/Database.php +++ b/lib/Database.php @@ -472,6 +472,7 @@ class Database { } if(sizeof($feed->changedItems)) { $qDeleteCategories = $this->db->prepare('DELETE FROM arsse_categories WHERE article is ?', 'int'); + $qClearReadMarks = $this->db->prepare('UPDATE arsse_subscription_articles SET read = 0, modified = CURRENT_TIMESTAMP WHERE article is ?', 'int'); $qUpdateArticle = $this->db->prepare( 'UPDATE arsse_articles SET url = ?, title = ?, author = ?, published = ?, edited = ?, modified = CURRENT_TIMESTAMP, guid = ?, content = ?, url_title_hash = ?, url_content_hash = ?, title_content_hash = ? WHERE id is ?', 'str', 'str', 'str', 'datetime', 'datetime', 'str', 'str', 'str', 'str', 'str', 'int' @@ -516,6 +517,7 @@ class Database { $qInsertCategories->run($articleID, $c); } $qInsertEdition->run($articleID); + $qClearReadMarks->run($articleID); } // lastly update the feed database itself with updated information. $this->db->prepare(