mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 17:24:56 +03:00
refactor(server): decouple generated images from image formats (#8246)
* rename thumbnail config update target paths, fix tests rename to image settings replace legacy enum better typing update sql update api remove config option fix * update docs * update other thumbnail configs in migration * keep legacy enum for now * fix jumbled job names * fix jumbled job names in tests * rename thumbhash job * rename dto * fix tests * preserve order * remove unused import * keep old fields in dto, marked deprecated * update sql --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
51
server/src/migrations/1711257900274-RenameWebpJpegPaths.ts
Normal file
51
server/src/migrations/1711257900274-RenameWebpJpegPaths.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class RenameWebpJpegPaths1711257900274 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.renameColumn('assets', 'webpPath', 'thumbnailPath');
|
||||
await queryRunner.renameColumn('assets', 'resizePath', 'previewPath');
|
||||
await queryRunner.query(`
|
||||
UPDATE system_config
|
||||
SET key = 'image.previewSize'
|
||||
WHERE key = 'thumbnail.jpegSize'`);
|
||||
await queryRunner.query(
|
||||
`UPDATE system_config
|
||||
SET key = 'image.thumbnailSize'
|
||||
WHERE key = 'thumbnail.webpSize'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`UPDATE system_config
|
||||
SET key = 'image.quality'
|
||||
WHERE key = 'thumbnail.quality'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`UPDATE system_config
|
||||
SET key = 'image.colorspace'
|
||||
WHERE key = 'thumbnail.colorspace'`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.renameColumn('assets', 'thumbnailPath', 'webpPath');
|
||||
await queryRunner.renameColumn('assets', 'previewPath', 'resizePath');
|
||||
await queryRunner.query(`
|
||||
UPDATE system_config
|
||||
SET key = 'thumbnail.jpegSize'
|
||||
WHERE key = 'image.previewSize'`);
|
||||
await queryRunner.query(
|
||||
`UPDATE system_config
|
||||
SET key = 'thumbnail.webpSize'
|
||||
WHERE key = 'image.thumbnailSize'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`UPDATE system_config
|
||||
SET key = 'thumbnail.quality'
|
||||
WHERE key = 'image.quality'`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`UPDATE system_config
|
||||
SET key = 'thumbnail.colorspace'
|
||||
WHERE key = 'image.colorspace'`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user