Build and Push Multi-Platform Images / build-and-push (push) Successful in 31s
- Task-Status: getTask() normalisiert die paginierte v10-Antwort (status klein, result_data, related_document_ids). Bisher wurde jede Task als „nicht gefunden“ gelöscht, ohne Nachbearbeitung. - Checksummen: Paperless ≥ 3.0 nutzt SHA-256 statt MD5. Duplikatprüfung umgestellt; Migration verbreitert Attachments.Checksum und berechnet Bestandswerte per SHA2() neu. - Custom-Field-Suche über custom_field_query, der alte Filter wurde von Paperless ignoriert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
73 lines
1.9 KiB
TypeScript
73 lines
1.9 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
ManyToOne,
|
|
OneToOne,
|
|
JoinColumn,
|
|
Index,
|
|
} from 'typeorm';
|
|
import { Email } from './email.entity';
|
|
import { Content } from './content.entity';
|
|
|
|
@Entity('Attachments')
|
|
export class Attachment {
|
|
@PrimaryGeneratedColumn({ type: 'int' })
|
|
Id!: number;
|
|
|
|
@Index('IX_Attachments_EmailMessageId')
|
|
@Column({ type: 'int' })
|
|
EmailMessageId!: number;
|
|
|
|
@Column({ type: 'varchar', length: 255 })
|
|
FileName!: string;
|
|
|
|
@Column({ type: 'varchar', length: 100 })
|
|
ContentType!: string;
|
|
|
|
@Column({ type: 'tinyint', width: 1 })
|
|
Erechnung!: boolean;
|
|
|
|
/** SHA-256 der Datei — entspricht der Checksumme in Paperless ≥ 3.0 */
|
|
@Column({ type: 'varchar', length: 64, default: '' })
|
|
Checksum!: string;
|
|
|
|
/**
|
|
* SHA-256 über den normalisierten PDF-Text (siehe pdf-fingerprint.util).
|
|
* Erkennt Duplikate, deren Datei neu erzeugt wurde (andere Checksumme).
|
|
* `''` = berechnet, aber ohne Textebene; `null` = noch nicht berechnet.
|
|
*/
|
|
@Index('IX_Attachments_ContentFingerprint')
|
|
@Column({ type: 'varchar', length: 64, nullable: true })
|
|
ContentFingerprint!: string | null;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
ContentId!: string | null;
|
|
|
|
@Column({ type: 'tinyint', width: 1 })
|
|
IsEmbedded!: boolean;
|
|
|
|
@Index('IX_Attachments_ParentId')
|
|
@Column({ type: 'int', nullable: true })
|
|
ParentId!: number | null;
|
|
|
|
@Column({ type: 'json', nullable: true })
|
|
PaperlessDocumentIds!: any | null;
|
|
|
|
@Column({ type: 'int', default: 0 })
|
|
ImportStatus!: number;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
InterneBelegnummer!: string | null;
|
|
|
|
@Column({ type: 'int', default: 0 })
|
|
PageCount!: number;
|
|
|
|
@ManyToOne(() => Email, (email) => email.Attachments)
|
|
@JoinColumn({ name: 'EmailMessageId' })
|
|
EmailMessage!: Email;
|
|
|
|
@OneToOne(() => Content, (content) => content.AttachmentEntity)
|
|
Content!: Content;
|
|
}
|