feat: Webhook verarbeitet jedes Dokument ohne Tag-16-Vorprüfung
Build and Push Multi-Platform Images / build-and-push (push) Successful in 38s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 38s
processDocumentById verarbeitet nun jedes vom Paperless-Webhook gemeldete Dokument, unabhängig vom Tag "paperlessmanager" (ID 16). Die Tag-Vorprüfung (skipped/tag-missing) entfällt. Die Konstante PAPERLESSMANAGER_TAG_ID bleibt für den manuellen Batch-Lauf processDocuments erhalten. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -66,19 +66,12 @@ export class PaperlessProcessorService {
|
|||||||
/**
|
/**
|
||||||
* Verarbeitet ein einzelnes Dokument anhand seiner ID – die ereignisgesteuerte
|
* Verarbeitet ein einzelnes Dokument anhand seiner ID – die ereignisgesteuerte
|
||||||
* Variante des früheren Cron-Jobs (vom Paperless-Webhook aufgerufen). Es wird
|
* Variante des früheren Cron-Jobs (vom Paperless-Webhook aufgerufen). Es wird
|
||||||
* nur verarbeitet, wenn das Dokument den Tag "paperlessmanager" trägt.
|
* jedes gemeldete Dokument verarbeitet, unabhängig vom Tag "paperlessmanager".
|
||||||
*/
|
*/
|
||||||
async processDocumentById(
|
async processDocumentById(
|
||||||
documentId: number,
|
documentId: number,
|
||||||
): Promise<{ processed: boolean; reason?: string }> {
|
): Promise<{ processed: boolean; reason?: string }> {
|
||||||
const doc = await this.paperlessService.getDocument(documentId);
|
const doc = await this.paperlessService.getDocument(documentId);
|
||||||
const tags: number[] = doc.tags || [];
|
|
||||||
if (!tags.includes(PAPERLESSMANAGER_TAG_ID)) {
|
|
||||||
this.logger.log(
|
|
||||||
`Dokument ${documentId} ohne Tag "paperlessmanager" (ID ${PAPERLESSMANAGER_TAG_ID}) – übersprungen.`,
|
|
||||||
);
|
|
||||||
return { processed: false, reason: 'tag-missing' };
|
|
||||||
}
|
|
||||||
|
|
||||||
const customFields = await this.paperlessService.getCustomFields();
|
const customFields = await this.paperlessService.getCustomFields();
|
||||||
const validFieldIds = new Set<number>(customFields.map((f: any) => f.id));
|
const validFieldIds = new Set<number>(customFields.map((f: any) => f.id));
|
||||||
|
|||||||
Reference in New Issue
Block a user