query amount of temporary uploads for statistics

This commit is contained in:
Bobby Wibowo 2020-12-25 21:18:45 +07:00
parent c6e83653db
commit 771a3f65d2
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -736,6 +736,7 @@ self.stats = async (req, res, next) => {
Images: 0,
Videos: 0,
Others: 0,
Temporary: 0,
'Size in DB': {
value: 0,
type: 'byte'
@ -768,6 +769,12 @@ self.stats = async (req, res, next) => {
})
.count('id as count')
.then(rows => rows[0].count)
})(),
(async () => {
stats[data.title].Temporary = await db.table('files')
.whereNotNull('expirydate')
.count('id as count')
.then(rows => rows[0].count)
})()
])