Skip to content

Commit 83ade2b

Browse files
committed
Fix sample data imports
1 parent 9619d97 commit 83ade2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/samples.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ router.post("/import", needAdmin, async (req: Request, res: Response) => {
3737
let cImage = -1;
3838
if (categoryData.cover) {
3939
const finalPath = `samples/covers/${categoryData.cover}`;
40-
cImage = (await db.addImage(finalPath, "", "", "")) || cImage;
40+
cImage = (await db.addImage(finalPath, "", "", "", false)) || cImage;
4141
await uploadFile(`./samples/covers/${categoryData.cover}`, finalPath);
4242
}
4343
const cId = await db.addCategory(categoryData.id, categoryData.name, cImage, categoryData.tags || []);
@@ -56,7 +56,7 @@ router.post("/import", needAdmin, async (req: Request, res: Response) => {
5656
for (const image of imageList.images) {
5757
const finalPath = `samples/${image.path}`;
5858
await uploadFile(`./samples/${image.path}`, finalPath);
59-
const iId = await db.addImage(finalPath, "", imageProviderData.author, imageProviderData.author_url);
59+
const iId = await db.addImage(finalPath, "", imageProviderData.author, imageProviderData.author_url, false);
6060
if (iId) {
6161
await db.addImageToCategory(cId, iId, parseSampleTags(image.tags || []));
6262
}

0 commit comments

Comments
 (0)