diff options
| author | Pitu <[email protected]> | 2021-01-05 16:38:44 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2021-01-05 16:38:44 +0900 |
| commit | 92f38085b06ed33ee7ffe6166162004757e497a0 (patch) | |
| tree | c9e41bce0d31a748d93c29404b5dabc21abc0ac5 /src/api/databaseMigration.js | |
| parent | chore: docs (diff) | |
| download | host.fuwn.me-92f38085b06ed33ee7ffe6166162004757e497a0.tar.xz host.fuwn.me-92f38085b06ed33ee7ffe6166162004757e497a0.zip | |
fix: dont save the file to album if no album
Diffstat (limited to 'src/api/databaseMigration.js')
| -rw-r--r-- | src/api/databaseMigration.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/api/databaseMigration.js b/src/api/databaseMigration.js index dcc71d6..24cfcff 100644 --- a/src/api/databaseMigration.js +++ b/src/api/databaseMigration.js @@ -118,10 +118,12 @@ const start = async () => { editedAt: moment.unix(file.timestamp).toDate() }; filesToInsert.push(fileToInsert); - albumsFilesToInsert.push({ - albumId: file.albumid, - fileId: file.id - }); + if (file.albumid) { + albumsFilesToInsert.push({ + albumId: file.albumid, + fileId: file.id + }); + } const filename = file.name; if (!jetpack.exists(nodePath.join(__dirname, '../../uploads', filename))) continue; |