feat(server): add transcode presets (#2084)

* 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>
This commit is contained in:
Sergey Kondrikov 2023-03-28 22:03:43 +03:00 committed by GitHub
parent b49f66bbc9
commit 2c67090e3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 216 additions and 45 deletions

View file

@ -3,8 +3,9 @@
import { fly } from 'svelte/transition';
export let value: string;
export let options: string[];
export let options: { value: string; text: string }[];
export let label = '';
export let name = '';
export let isEdited = false;
const handleChange = (e: Event) => {
@ -14,7 +15,7 @@
<div class="w-full">
<div class={`flex place-items-center gap-1 h-[26px]`}>
<label class={`immich-form-label text-sm`} for={label}>{label}</label>
<label class={`immich-form-label text-sm`} for="{name}-select">{label}</label>
{#if isEdited}
<div
@ -27,13 +28,13 @@
</div>
<select
class="immich-form-input w-full"
name="presets"
id="preset-select"
{name}
id="{name}-select"
bind:value
on:change={handleChange}
>
{#each options as option}
<option value={option}>{option}</option>
<option value={option.value}>{option.text}</option>
{/each}
</select>
</div>