feat: implement region-based QR code scanning for inbox documents
Build and Push Multi-Platform Images / build-and-push (push) Successful in 33s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 33s
This commit is contained in:
@@ -44,8 +44,8 @@ export class InboxService {
|
||||
|
||||
async listFiles(preferredUsername: string | null): Promise<InboxFile[]> {
|
||||
const where = preferredUsername
|
||||
? [{ Source: 'all' as InboxSource }, { Source: 'user' as InboxSource, OwnerUsername: preferredUsername }]
|
||||
: [{ Source: 'all' as InboxSource }];
|
||||
? [{ Source: 'all' as InboxSource, IsScanned: true }, { Source: 'user' as InboxSource, OwnerUsername: preferredUsername, IsScanned: true }]
|
||||
: [{ Source: 'all' as InboxSource, IsScanned: true }];
|
||||
|
||||
const docs = await this.documentRepo.find({
|
||||
where,
|
||||
@@ -212,4 +212,17 @@ export class InboxService {
|
||||
|
||||
await this.documentRepo.save(doc);
|
||||
}
|
||||
|
||||
async scanRegion(
|
||||
id: string,
|
||||
page: number,
|
||||
x: number,
|
||||
y: number,
|
||||
w: number,
|
||||
h: number,
|
||||
preferredUsername: string | null,
|
||||
): Promise<{ found: string[] }> {
|
||||
const { doc, pdfPath } = await this.resolveDocument(id, preferredUsername);
|
||||
return this.barcodeScanner.scanRegion(doc, pdfPath, page, x, y, w, h);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user