From 4facb78bc097276335a2fc5e8bc946b3bbf798d4 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Tue, 22 Oct 2024 00:49:26 -0600 Subject: [PATCH] fix name doubling --- lib/fileworker.js | 3 +++ server.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/fileworker.js b/lib/fileworker.js index 5a9bf2d..0994ff8 100644 --- a/lib/fileworker.js +++ b/lib/fileworker.js @@ -84,6 +84,9 @@ function findCategory(str, catList){ foundCat = "Others" } } + if(foundSubCat.includes(foundCat)){ + foundCat = '' + } return `${foundCat} ${foundSubCat}`.trim() } diff --git a/server.js b/server.js index cc71250..d339912 100644 --- a/server.js +++ b/server.js @@ -50,9 +50,9 @@ async function getFilesJob() { console.log("Updating the file list."); fileList = await getAllFiles(categoryList); await FileHandler.saveJsonFile(fileListPath, fileList); + fileCount = fileList.length; if (typeof search !== "undefined") { await search.createIndex(fileList, searchFields); //recreate the search index - fileCount = fileList.length; //fileList = [] } crawlTime = await FileHandler.fileTime(fileListPath);