fix: update upload directories

This commit is contained in:
Kana 2021-09-02 02:04:57 +09:00 committed by GitHub
parent f262fa8069
commit 58864852d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -42,8 +42,8 @@ const start = async () => {
console.log('Starting migration, this may take a few minutes...'); // Because I half assed it
console.log('Please do NOT kill the process. Wait for it to finish.');
await jetpack.removeAsync(nodePath.join(__dirname, '../../uploads/thumbs'));
await jetpack.dirAsync(nodePath.join(__dirname, '../../uploads/thumbs/square'));
await jetpack.removeAsync(nodePath.join(__dirname, '../../../uploads/thumbs'));
await jetpack.dirAsync(nodePath.join(__dirname, '../../../uploads/thumbs/square'));
console.log('Finished deleting old thumbnails to create new ones');
const users = await oldDb.table('users').where('username', '<>', 'root');
@ -121,7 +121,7 @@ const start = async () => {
}
const filename = file.name;
if (!jetpack.exists(nodePath.join(__dirname, '../../uploads', filename))) continue;
if (!jetpack.exists(nodePath.join(__dirname, '../../../uploads', filename))) continue;
ThumbUtil.generateThumbnails(filename);
}
await newDb.batchInsert('files', filesToInsert, 20);