diff --git a/lib/Database.php b/lib/Database.php index 466a036..55c21e0 100644 --- a/lib/Database.php +++ b/lib/Database.php @@ -1750,7 +1750,7 @@ class Database { return $out; } - /** Returns statistics about the articles starred by the given user + /** Returns statistics about the articles starred by the given user. Hidden articles are excluded * * The associative array returned has the following keys: * @@ -1765,7 +1765,7 @@ class Database { coalesce(sum(abs(\"read\" - 1)),0) as unread, coalesce(sum(\"read\"),0) as \"read\" FROM ( - select \"read\" from arsse_marks where starred = 1 and subscription in (select id from arsse_subscriptions where owner = ?) + select \"read\" from arsse_marks where starred = 1 and hidden <> 1 and subscription in (select id from arsse_subscriptions where owner = ?) ) as starred_data", "str" )->run($user)->getRow(); diff --git a/tests/cases/Database/SeriesArticle.php b/tests/cases/Database/SeriesArticle.php index 37dc10b..a6b6bdb 100644 --- a/tests/cases/Database/SeriesArticle.php +++ b/tests/cases/Database/SeriesArticle.php @@ -252,6 +252,7 @@ trait SeriesArticle { [12, 4,1,1,'2017-01-01 00:00:00','ach',0], [1, 2,0,0,'2010-01-01 00:00:00','Some Note',0], [3, 5,0,0,'2000-01-01 00:00:00','',1], + [6, 1,0,1,'2010-01-01 00:00:00','',1], ], ], 'arsse_categories' => [ // author-supplied categories @@ -969,7 +970,7 @@ trait SeriesArticle { $setSize = (new \ReflectionClassConstant(Database::class, "LIMIT_SET_SIZE"))->getValue(); $this->assertSame(2, Arsse::$db->articleCount("john.doe@example.com", (new Context)->starred(true))); $this->assertSame(4, Arsse::$db->articleCount("john.doe@example.com", (new Context)->folder(1))); - $this->assertSame(0, Arsse::$db->articleCount("jane.doe@example.com", (new Context)->starred(true))); + $this->assertSame(1, Arsse::$db->articleCount("jane.doe@example.com", (new Context)->starred(true))); $this->assertSame(10, Arsse::$db->articleCount("john.doe@example.com", (new Context)->articles(range(1, $setSize * 3)))); }