mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
fix: count of album zips generated in stats
change logic to list physical files instead, since the zipGeneratedAt attribute may still exist despite site owners having already done physical clean-ups
This commit is contained in:
parent
ecdeaa8b8a
commit
395361d5fc
@ -967,9 +967,12 @@ self.stats = async (req, res, next) => {
|
||||
activeAlbums.push(album.id)
|
||||
if (album.download) stats[data.title].Downloadable++
|
||||
if (album.public) stats[data.title].Public++
|
||||
if (album.zipGeneratedAt) stats[data.title]['ZIP Generated']++
|
||||
}
|
||||
|
||||
await paths.readdir(paths.zips).then(files => {
|
||||
stats[data.title]['ZIP Generated'] = files.length
|
||||
}).catch(() => {})
|
||||
|
||||
stats[data.title]['Files in albums'] = await db.table('files')
|
||||
.whereIn('albumid', activeAlbums)
|
||||
.count('id as count')
|
||||
|
Loading…
Reference in New Issue
Block a user