From 7700b4bd4ae1afe14c7599b349ea890f0284820a Mon Sep 17 00:00:00 2001 From: silver Date: Wed, 19 Nov 2025 11:19:45 +0100 Subject: [PATCH] refactor by querying specific file Signed-off-by: silver --- src/view/FilesAppIntegration.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/view/FilesAppIntegration.js b/src/view/FilesAppIntegration.js index de3855993..a146189e4 100644 --- a/src/view/FilesAppIntegration.js +++ b/src/view/FilesAppIntegration.js @@ -550,23 +550,19 @@ export default { } try { - // Query the directory containing the file, not the file itself + const path = `${this.filePath}/${basename}` const client = davGetClient() - const results = await client.getDirectoryContents(`${davRootPath}${this.filePath}`, { + const results = await client.getDirectoryContents(`${davRootPath}${path}`, { details: true, data: davGetDefaultPropfind(), }) - - // Find the specific file in the directory listing - const nodes = results.data - .map((result) => davResultToNode(result)) - .filter((node) => node.basename === basename) + const nodes = results.data.map((result) => davResultToNode(result)) if (nodes[0]) { console.debug('[FilesAppIntegration] Emitting files:node:created for', basename) emit('files:node:created', nodes[0]) } else { - console.warn('[FilesAppIntegration] New file not found in directory:', basename) + console.warn('[FilesAppIntegration] New file not found:', basename) } } catch (e) { console.error('Failed to fetch new file metadata from webdav', e)