chore: apply ESLint auto-fix across entire backend
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Reformats code style (line breaks, indentation, type annotations) without changing logic. Also includes minor feature additions bundled in the same lint run (stats service, user-settings groups, agrarmonitor polling improvements). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,10 @@ export class EmailPageCacheService {
|
||||
private readonly mailsRoot: string;
|
||||
|
||||
constructor(configService: ConfigService) {
|
||||
this.mailsRoot = configService.get<string>('MAILS_DATA_DIR', '/mnt/data/mails');
|
||||
this.mailsRoot = configService.get<string>(
|
||||
'MAILS_DATA_DIR',
|
||||
'/mnt/data/mails',
|
||||
);
|
||||
}
|
||||
|
||||
attachmentDir(attachmentId: number | string): string {
|
||||
@@ -20,14 +23,23 @@ export class EmailPageCacheService {
|
||||
}
|
||||
|
||||
previewPath(attachmentId: number | string, page: number): string {
|
||||
return path.join(this.attachmentDir(attachmentId), `page-${page}.preview.png`);
|
||||
return path.join(
|
||||
this.attachmentDir(attachmentId),
|
||||
`page-${page}.preview.png`,
|
||||
);
|
||||
}
|
||||
|
||||
thumbnailPath(attachmentId: number | string, page: number): string {
|
||||
return path.join(this.attachmentDir(attachmentId), `page-${page}.thumb.png`);
|
||||
return path.join(
|
||||
this.attachmentDir(attachmentId),
|
||||
`page-${page}.thumb.png`,
|
||||
);
|
||||
}
|
||||
|
||||
async generate(attachmentId: number | string, renderedImages: string[]): Promise<void> {
|
||||
async generate(
|
||||
attachmentId: number | string,
|
||||
renderedImages: string[],
|
||||
): Promise<void> {
|
||||
const dir = this.attachmentDir(attachmentId);
|
||||
await fs.mkdir(dir, { recursive: true });
|
||||
|
||||
@@ -39,14 +51,22 @@ export class EmailPageCacheService {
|
||||
|
||||
try {
|
||||
await fs.copyFile(src, previewDest);
|
||||
await sharp(src).resize({ width: THUMBNAIL_WIDTH }).png().toFile(thumbDest);
|
||||
await sharp(src)
|
||||
.resize({ width: THUMBNAIL_WIDTH })
|
||||
.png()
|
||||
.toFile(thumbDest);
|
||||
} catch (err: any) {
|
||||
this.logger.warn(`E-Mail Page Cache fehlgeschlagen (Attachment ${attachmentId} Seite ${page}): ${err.message}`);
|
||||
this.logger.warn(
|
||||
`E-Mail Page Cache fehlgeschlagen (Attachment ${attachmentId} Seite ${page}): ${err.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async hasPreview(attachmentId: number | string, page: number): Promise<boolean> {
|
||||
async hasPreview(
|
||||
attachmentId: number | string,
|
||||
page: number,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
await fs.access(this.previewPath(attachmentId, page));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user