refresh archive folder after import

This commit is contained in:
Jan Prochazka
2020-11-15 20:46:42 +01:00
parent 801bf05a31
commit 72776f3297
3 changed files with 30 additions and 6 deletions

View File

@@ -34,7 +34,9 @@ module.exports = {
files_meta: 'get',
async files({ folder }) {
const files = await fs.readdir(path.join(archivedir(), folder));
const dir = path.join(archivedir(), folder);
if (!(await fs.exists(dir))) return [];
const files = await fs.readdir(dir);
return files
.filter((name) => name.endsWith('.jsonl'))
.map((name) => ({