From e91748c0bcc783916553fcc0cb40734c607dc469 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 16 Sep 2021 15:53:07 -0400 Subject: [PATCH] Return correct count of currently-published lang posts Previously, we'd include scheduled posts, too. Ref T805 --- database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.go b/database.go index 227fc0e..efc1a10 100644 --- a/database.go +++ b/database.go @@ -1262,7 +1262,7 @@ func (db *datastore) GetPostsTagged(cfg *config.Config, c *Collection, tag strin func (db *datastore) GetCollLangTotalPosts(collID int64, lang string) (uint64, error) { var articles uint64 - err := db.QueryRow("SELECT COUNT(*) FROM posts WHERE collection_id = ? AND language = ?", collID, lang).Scan(&articles) + err := db.QueryRow("SELECT COUNT(*) FROM posts WHERE collection_id = ? AND language = ? AND created <= "+db.now(), collID, lang).Scan(&articles) if err != nil && err != sql.ErrNoRows { log.Error("Couldn't get total lang posts count for collection %d: %v", collID, err) return 0, err