From 76328fa058ace3c853f44042cb8f2e782b36be4b Mon Sep 17 00:00:00 2001 From: tianmo Date: Sat, 17 Oct 2026 16:19:18 +0800 Subject: [PATCH] feat: add thumbnail timeout and low-memory warning --- app/components/UploadPreferencesPanel.vue | 21 ++++++ .../SettingsVideoProcessingFields.vue | 21 ++++++ app/composables/useTranscodeSettings.ts | 13 ++++ i18n/locales/en.json | 2 + i18n/locales/zh-CN.json | 2 + server/api/videos/transcode-settings.get.ts | 7 +- server/utils/system-resources.test.ts | 24 +++++++ server/utils/system-resources.ts | 42 ++++++++++++ server/utils/transcode.test.ts | 15 ++++- server/utils/transcode.ts | 66 ++++++++++++++----- 10 files changed, 196 insertions(+), 17 deletions(-) create mode 100644 server/utils/system-resources.test.ts create mode 100644 server/utils/system-resources.ts diff --git a/app/components/UploadPreferencesPanel.vue b/app/components/UploadPreferencesPanel.vue index 5f6f5ae..03ce0ff 100644 --- a/app/components/UploadPreferencesPanel.vue +++ b/app/components/UploadPreferencesPanel.vue @@ -31,6 +31,11 @@ const gridClass = computed(() => { }) const { t } = useI18n() +const { + lowMemory, + memoryBytes, + load: loadTranscodeSettings +} = useTranscodeSettings() const { userSettings, @@ -52,6 +57,12 @@ const clientQualityLevel = computed(() => { return t('preferences.qualityLow') }) +const memoryGb = computed(() => ( + memoryBytes.value > 0 + ? (memoryBytes.value / (1024 * 1024 * 1024)).toFixed(1) + : '—' +)) + function setCopyFormat(value: 'url' | 'markdown' | 'html' | 'bbcode') { copyFormat.value = value } @@ -64,6 +75,7 @@ function onClientQualityInput(event: Event) { onMounted(() => { loadPreferences() void loadUserSettings() + void loadTranscodeSettings() }) @@ -170,6 +182,15 @@ onMounted(() => { {{ t('preferences.videoProcessing') }} + +