From a0d8ee03171b0b15493342ba319ffcec8738eb3e Mon Sep 17 00:00:00 2001 From: Mohammed Abad Date: Wed, 22 Apr 2026 02:08:01 +0100 Subject: [PATCH] Backend: statistics accuracy filter and maintenance docs - statisticsController: filter CouchDayChart data to accuracy='EXACT' - Documented maintenance endpoints and statistics changes in docs-vault --- backend/controllers/statisticsController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/controllers/statisticsController.js b/backend/controllers/statisticsController.js index 6fe7af4..3eaebf6 100644 --- a/backend/controllers/statisticsController.js +++ b/backend/controllers/statisticsController.js @@ -123,11 +123,13 @@ class StatisticsController { async getWatchdayDistribution(req, res) { try { // DAYOFWEEK: 1=Sunday, 2=Monday ... 7=Saturday + // Only count records with EXACT accuracy const episodeDays = await EpisodeSeen.findAll({ attributes: [ [sequelize.fn('DAYOFWEEK', sequelize.col('date_seen')), 'day'], [sequelize.fn('COUNT', sequelize.col('*')), 'count'] ], + where: { accuracy: 'EXACT' }, group: [sequelize.fn('DAYOFWEEK', sequelize.col('date_seen'))] }); @@ -136,6 +138,7 @@ class StatisticsController { [sequelize.fn('DAYOFWEEK', sequelize.col('date_seen')), 'day'], [sequelize.fn('COUNT', sequelize.col('*')), 'count'] ], + where: { accuracy: 'EXACT' }, group: [sequelize.fn('DAYOFWEEK', sequelize.col('date_seen'))] });