From 288ff0d18c048525bc05336a5ad1ce53c6f519b6 Mon Sep 17 00:00:00 2001 From: Sean Hatfield Date: Mon, 22 Jan 2024 13:03:05 -0800 Subject: [PATCH] fix vector cache not deleting cache after unembedding items with folders (#630) --- collector/utils/extensions/YoutubeTranscript/index.js | 1 + .../Modals/MangeWorkspace/Documents/Directory/index.jsx | 3 ++- server/utils/files/purgeDocument.js | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/collector/utils/extensions/YoutubeTranscript/index.js b/collector/utils/extensions/YoutubeTranscript/index.js index 7e88bb7a..22540dbb 100644 --- a/collector/utils/extensions/YoutubeTranscript/index.js +++ b/collector/utils/extensions/YoutubeTranscript/index.js @@ -88,6 +88,7 @@ async function loadYouTubeTranscript({ url }) { data: { title: metadata.title, author: metadata.author, + destination: outFolder, }, }; } diff --git a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/index.jsx b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/index.jsx index 8a140a41..af8ae32a 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/index.jsx @@ -91,7 +91,8 @@ export default function Directory({ ) : !!files.items ? ( files.items.map( (item, index) => - item.type === "folder" && ( + (item.name === "custom-documents" || + (item.type === "folder" && item.items.length > 0)) && ( path.join(subFolderPath, file)); + .map((file) => + path.join(subFolderPath, file).replace(documentsPath + "/", "") + ); const workspaces = await Workspace.where(); const purgePromises = [];