diff --git a/.changeset/cold-walls-drop.md b/.changeset/cold-walls-drop.md new file mode 100644 index 0000000..cbd3651 --- /dev/null +++ b/.changeset/cold-walls-drop.md @@ -0,0 +1,5 @@ +--- +"@papra/app-server": patch +--- + +Fix a bug where the ingestion folder was not working when the done or error destination folder path (INGESTION_FOLDER_POST_PROCESSING_MOVE_FOLDER_PATH and INGESTION_FOLDER_ERROR_FOLDER_PATH) were absolute. diff --git a/apps/papra-server/src/modules/ingestion-folders/ingestion-folders.usecases.ts b/apps/papra-server/src/modules/ingestion-folders/ingestion-folders.usecases.ts index e84edef..07054c0 100644 --- a/apps/papra-server/src/modules/ingestion-folders/ingestion-folders.usecases.ts +++ b/apps/papra-server/src/modules/ingestion-folders/ingestion-folders.usecases.ts @@ -235,10 +235,10 @@ async function buildPathIgnoreFunction({ const { organizationIds } = await organizationsRepository.getAllOrganizationIds(); const doneFolders = strategy === 'move' - ? isAbsolute(moveToFolderPath) ? moveToFolderPath : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, moveToFolderPath))) + ? isAbsolute(moveToFolderPath) ? [moveToFolderPath] : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, moveToFolderPath))) : []; - const errorFolders = isAbsolute(errorFolder) ? errorFolder : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, errorFolder))); + const errorFolders = isAbsolute(errorFolder) ? [errorFolder] : uniq(organizationIds.map(id => join(cwd, folderRootPath, id, errorFolder))); const ignoredFolders = [...doneFolders, ...errorFolders]; const matchExcludedPatterns = picomatch(ignoredPatterns);