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);