The next-generation file converter. Open source, fully local* and free forever.
feat: file card size 2
JovannMCe9697e86a335
diff --git a/messages/en.json b/messages/en.jsonindex 418a751..d05d35b 100644--- a/messages/en.json+++ b/messages/en.json@@ -211,7 +211,10 @@"server": "what are you doing..? you're supposed to run the vertd server!","not_found": "Could not find the vertd instance to start video conversion. Are you sure the instance URL is set correctly?","ratelimit": "Your video, '{filename}', has failed to convert a few times. To prevent server overload, further conversion attempts for this file have been temporarily blocked. Please try again later.",- "file_too_large": "This file is too big for the specified vertd server ({fileSize}/{limit}). Try another server or converter.",+ "file_too_large": {+ "text": "This file is <b>{fileSize}</b>, but the selected vertd server only supports files up to <b>{limit}</b>.\nTry using a smaller file, different format, or change your vertd server in Settings.",+ "button": "Change converter"+ },"failed_to_keep": "Failed to keep the video on the server: {error}","retry": "Retrying video conversion for {filename} with different settings due to failure. This may take longer than usual.","generic": {diff --git a/src/lib/components/functional/FormatDropdown.svelte b/src/lib/components/functional/FormatDropdown.svelteindex a4ef16b..2b61f08 100644--- a/src/lib/components/functional/FormatDropdown.svelte+++ b/src/lib/components/functional/FormatDropdown.svelte@@ -1,14 +1,13 @@<script lang="ts">import { duration, fade, transition } from "$lib/util/animation";import { m } from "$lib/paraglide/messages";- import { isMobile, files, dropdownStates } from "$lib/store/index.svelte";+ import { isMobile, files, dropdownStates, fileSettings } from "$lib/store/index.svelte";import type { Categories } from "$lib/types";import clsx from "clsx";import { ChevronDown, SearchIcon } from "@lucide/svelte";import { onMount } from "svelte";import { quintOut } from "svelte/easing";import { VertFile } from "$lib/types";- import SettingsModal from "./popups/SettingsModal.svelte";import { log } from "$lib/util/logger";import FancyInput from "./FancyInput.svelte";@@ -36,7 +35,6 @@let dropdown = $state<HTMLDivElement>();let dropdownMenu: HTMLElement | undefined = $state();let dropdownPosition = $state<"left" | "center" | "right">("center");- let showSettingsModal = $state(false);let currentCategory = $state<string | null>(null);let searchQuery = $state("");let rootCategory: string | null = null;@@ -395,14 +393,6 @@newFiles.forEach((f) => files.add(f));};- const settings = () => {- log(- ["dropdown", "settings"],- `opening settings modal for ${file?.name ?? "all files"}`,- );- showSettingsModal = true;- };-onMount(() => {const handleClickOutside = (e: MouseEvent) => {if (dropdown && !dropdown.contains(e.target as Node)) open = false;@@ -425,10 +415,6 @@});</script>-{#if showSettingsModal}- <SettingsModal {file} onclose={() => (showSettingsModal = false)} />-{/if}-<divclass="relative w-full min-w-fit text-xl font-medium text-center"bind:this={dropdown}@@ -646,7 +632,7 @@<div class="border-t border-separator text-base p-2"><buttonclass="w-full p-2 text-center rounded-lg bg-accent text-black"- onclick={() => settings()}+ onclick={() => $fileSettings = file}>{m["convert.settings.settings"]()}</button>diff --git a/src/lib/store/index.svelte.ts b/src/lib/store/index.svelte.tsindex 2f53249..ae3b3cc 100644--- a/src/lib/store/index.svelte.ts+++ b/src/lib/store/index.svelte.ts@@ -507,6 +507,7 @@ export const goingLeft = writable(false);export const dropping = writable(false);export const vertdLoaded = writable(false);export const dropdownStates = writable<Record<string, string>>({});+export const fileSettings = $state(writable<VertFile | undefined | null>(null)); // undefined = all files, null = hiddenexport const isMobile = writable(false);export const effects = writable(true);diff --git a/src/routes/convert/+page.svelte b/src/routes/convert/+page.svelteindex 04955bd..d2fa65b 100644--- a/src/routes/convert/+page.svelte+++ b/src/routes/convert/+page.svelte@@ -16,6 +16,8 @@gradientColor,showGradient,dropdownStates,+ fileSettings,+ sanitize,} from "$lib/store/index.svelte";import { VertFile } from "$lib/types";import {@@ -37,6 +39,7 @@import { GB } from "$lib/util/consts";import { formatBytes } from "$lib/util/file";import { vertdSizeLimit } from "$lib/sections/settings/vertdSettings.svelte";+ import SettingsModal from "$lib/components/functional/popups/SettingsModal.svelte";let processedFileIds = $state(new Set<string>());@@ -44,12 +47,14 @@const converterName = file.conversionSettings.converter;const availableConverters = file.isZip()? file.converters- : file.findConverters();+ : file.to+ ? file.findConverters([file.from, file.to])+ : file.findConverters();if (converterName) {- const selectedConverter =- availableConverters.find((c) => c.name === converterName) ||- file.converters.find((c) => c.name === converterName);+ const selectedConverter = availableConverters.find(+ (c) => c.name === converterName,+ );if (selectedConverter) return selectedConverter;}@@ -278,21 +283,37 @@{m["convert.errors.format_output_only"]()}</p></div>- {:else if size > limit}- <div- class="h-full flex flex-col text-center justify-center text-failure"- >- <p class="font-body font-bold">- {m["convert.errors.cant_convert"]()}- </p>- <p class="font-normal">- {m["convert.errors.vertd.file_too_large"]({- fileSize: formatBytes(size),- limit: formatBytes(limit),- })}- </p>+ {:else if size > limit && currentConverter.name === "vertd"}+ <div class="h-full flex flex-col justify-between">+ <div+ class="flex flex-col text-center justify-center text-failure"+ >+ <p class="font-body font-bold">+ {m["convert.errors.cant_convert"]()}+ </p>+ <p class="font-normal whitespace-pre-line">+ {@html sanitize(m["convert.errors.vertd.file_too_large.text"]({+ fileSize: formatBytes(size),+ limit: formatBytes(limit),+ }))}+ </p>+ </div>+ <div class="flex p-2 justify-center gap-4">+ <FormatDropdown+ {categories}+ from={file.from}+ bind:selected={file.to}+ onselect={(option) => handleSelect(option, file)}+ {file}+ />+ <button+ class="w-full p-2 text-center rounded-lg bg-accent text-black"+ onclick={() => ($fileSettings = file)}+ >+ {m["convert.errors.vertd.file_too_large.button"]()}+ </button>+ </div></div>- <!-- TODO: add settings button to change to mediabunny, only show if vertd is actually being used -->{:else if isLarge && !file.supportsStreaming()}<divclass="h-full flex flex-col text-center justify-center text-failure"@@ -483,3 +504,10 @@{/if}</div></div>++{#if $fileSettings instanceof VertFile}+ <SettingsModal+ file={$fileSettings}+ onclose={() => ($fileSettings = null)}+ />+{/if}