This commit is contained in:
Flummi 2022-01-06 04:09:19 +01:00
parent 30c13a1cfb
commit 2f0e2c5070

View File

@ -11,7 +11,7 @@ const count = {
}; };
const rows = await sql('items').select('id', 'dest'); const rows = await sql('items').select('id', 'dest');
const ids = rows.map(r => r.id.toString() + ".png"); const ids = rows.map(r => r.id.toString() + ".webp");
const dests = rows.map(r => r.dest); const dests = rows.map(r => r.dest);
const files = { const files = {
b: (await fs.readdir(opts.b)).filter(f => f !== '.empty'), b: (await fs.readdir(opts.b)).filter(f => f !== '.empty'),
@ -30,4 +30,4 @@ count.t = (await Promise.all(unused.t.map(f => fs.rm(`${opts.t}/${f}`)))).length
const tmp = (await fs.readdir(opts.tmp)).filter(f => f !== '.empty'); const tmp = (await fs.readdir(opts.tmp)).filter(f => f !== '.empty');
count.tmp = (await Promise.all(tmp.map(f => fs.rm(`${opts.tmp}/${f}`)))).length; count.tmp = (await Promise.all(tmp.map(f => fs.rm(`${opts.tmp}/${f}`)))).length;
console.log(count); console.log(count, unused);