Update the series view command to be in greyscale if the user has not claimed the card #297

Merged
Vylpes merged 5 commits from feature/279-series-view-image-grid-2 into develop 2024-07-12 17:35:13 +01:00
Showing only changes of commit bdb6f3da3d - Show all commits

View file

@ -1,7 +1,7 @@
import {createCanvas, loadImage} from "canvas"; import {createCanvas, loadImage} from "canvas";
import path from "path"; import path from "path";
import AppLogger from "../client/appLogger"; import AppLogger from "../client/appLogger";
import {existsSync, readFileSync} from "fs"; import {existsSync} from "fs";
import Inventory from "../database/entities/app/Inventory"; import Inventory from "../database/entities/app/Inventory";
import Jimp from "jimp"; import Jimp from "jimp";
@ -36,7 +36,7 @@ export default class ImageHelper {
continue; continue;
} }
let imageData = await Jimp.read(filePath); const imageData = await Jimp.read(filePath);
if (userId != null) { if (userId != null) {
const claimed = await Inventory.FetchOneByCardNumberAndUserId(userId, card.id) != null; const claimed = await Inventory.FetchOneByCardNumberAndUserId(userId, card.id) != null;