export model WIP

This commit is contained in:
Jan Prochazka
2021-09-20 16:31:21 +02:00
parent 760f5c9616
commit 3e1f947922
3 changed files with 26 additions and 0 deletions

View File

@@ -95,4 +95,13 @@ module.exports = {
});
});
},
async getNewArchiveFolder({ database }) {
if (!(await fs.exists(path.join(archivedir(), database)))) return database;
let index = 2;
while (await fs.exists(path.join(archivedir(), `${database}${index}`))) {
index += 1;
}
return `${database}${index}`;
},
};