Skip to content

Commit

Permalink
Fi scan cannot add file to database
Browse files Browse the repository at this point in the history
  • Loading branch information
soruly committed Oct 16, 2024
1 parent 7bd0063 commit 7014200
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ export default async (req, res) => {
const newFileList = videoFileList.filter((e) => !dbFileSet.has(e));

if (newFileList.length) {
await knex("file").insert(
newFileList.map((e) => ({
path: e,
status: "UPLOADED",
})),
);
await knex("file")
.insert(
newFileList.map((e) => ({
path: e,
status: "UPLOADED",
})),
)
.onConflict("path")
.ignore();
}

res.json({
Expand Down

0 comments on commit 7014200

Please # to comment.