Backend: statistics accuracy filter and maintenance docs
- statisticsController: filter CouchDayChart data to accuracy='EXACT' - Documented maintenance endpoints and statistics changes in docs-vault
This commit is contained in:
1 parent
1cc75a94ef
commit
a0d8ee0317
1 file changed
+3
@@ -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'))]
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user