mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* feat: add transcode presets * Add migration * chore: generate api * refactor: use enum type instead of string for transcode option * chore: generate api * refactor: enhance readability of runVideoEncode method * refactor: reuse SettingSelect for transcoding presets * refactor: simplify return statement * chore: regenerate api * fix: correct label attribute * Update import * fix test --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
28 lines
828 B
TypeScript
28 lines
828 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class UpdateTranscodeOption1679751316282 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
UPDATE system_config
|
|
SET
|
|
key = 'ffmpeg.transcode',
|
|
value = '"all"'
|
|
WHERE
|
|
key = 'ffmpeg.transcodeAll' AND value = 'true'
|
|
`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
UPDATE system_config
|
|
SET
|
|
key = 'ffmpeg.transcodeAll',
|
|
value = 'true'
|
|
WHERE
|
|
key = 'ffmpeg.transcode' AND value = '"all"'
|
|
`);
|
|
|
|
await queryRunner.query(`DELETE FROM "system_config" WHERE key = 'ffmpeg.transcode'`);
|
|
}
|
|
}
|