From 7fcd1db98724fb1a91b3f485be172c0afb9d24cc Mon Sep 17 00:00:00 2001 From: kaireewu Date: Sat, 31 Oct 2026 23:54:56 +0800 Subject: [PATCH] fix(web): count initial import from tracked videos --- reaction_board/web/queries.py | 3 ++- tests/test_web_queries.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reaction_board/web/queries.py b/reaction_board/web/queries.py index 0a08237..47906f1 100644 --- a/reaction_board/web/queries.py +++ b/reaction_board/web/queries.py @@ -321,7 +321,8 @@ class DashboardQueries: initial_import_count = 0 if first_seen_ts is not None: initial_import_count = int(conn.execute( - "SELECT COUNT(*) FROM video WHERE first_seen = ?", + "SELECT COUNT(*) FROM video WHERE first_seen = ? " + "AND status IN ('active','unfaved')", (int(first_seen_ts),), ).fetchone()[0]) diff --git a/tests/test_web_queries.py b/tests/test_web_queries.py index 2f4a083..4c89f64 100644 --- a/tests/test_web_queries.py +++ b/tests/test_web_queries.py @@ -35,6 +35,7 @@ def test_overview(): assert overview["data_date"] == DATES[-1] assert overview["snapshot_days"] == 3 assert overview["is_first_day"] is False + assert overview["initial_import_count"] == 2 assert overview["counts"]["active"] == 2 assert overview["counts"]["unfaved"] == 1 assert overview["counts"]["removed"] == 1