From 12c85ed1250b3344005404339f00fc763f603798 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Fri, 30 Oct 2026 10:29:35 +0800 Subject: [PATCH] fix: construct full file path for unregistered files - quickRegister now builds full path when file_path is empty - Uses default upload base path: /Users/accusys/momentry/var/sftpgo/data/demo - Fixes 500 error when registering unregistered files --- src/views/LibraryView.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/views/LibraryView.vue b/src/views/LibraryView.vue index 27636b9..30fb290 100644 --- a/src/views/LibraryView.vue +++ b/src/views/LibraryView.vue @@ -727,7 +727,13 @@ const { isAdvanced } = useAdvancedMode() const { autoScanAfterRegister, toggleAutoScan } = useAutoScan() const router = useRouter() -const files = computed(() => filesCache.value) +const files = computed(() => { + // Filter out files with invalid paths (e.g., /tmp, /private/tmp) + return filesCache.value.filter((f: any) => { + const path = f.file_path || '' + return !path.startsWith('/tmp') && !path.startsWith('/private/tmp') + }) +}) const loading = computed(() => !filesLoaded.value) const statusText = ref('') const filterText = ref('') @@ -2093,7 +2099,14 @@ async function batchUnregister() { async function quickRegister(f: any) { if (registering.value) return - const filePath = f.file_path || f.relative_path || f.file_name + // Construct full file path if missing + let filePath = f.file_path || f.relative_path + if (!filePath) { + // Fallback: construct from known upload base path + const basePath = '/Users/accusys/momentry/var/sftpgo/data/demo' + filePath = `${basePath}/${f.file_name}` + } + if (!filePath) { actionMsg.value = 'Missing file path' setTimeout(() => { actionMsg.value = '' }, 8000)