mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
feat: delete zip of empty albums on download req
This commit is contained in:
parent
d5b1ad69d9
commit
34c060ec5e
@ -607,6 +607,8 @@ self.generateZip = async (req, res) => {
|
||||
.where('albumid', album.id)
|
||||
if (files.length === 0) {
|
||||
logger.log(`Finished zip task for album: ${identifier} (no files).`)
|
||||
// Remove album ZIP if it exists
|
||||
await jetpack.removeAsync(path.join(paths.zips, `${identifier}.zip`))
|
||||
const clientErr = new ClientError('There are no files in the album.', { statusCode: 200 })
|
||||
self.zipEmitters.get(identifier).emit('done', null, null, clientErr)
|
||||
throw clientErr
|
||||
|
Loading…
Reference in New Issue
Block a user