From 37a4618fa6fb25486e71c09f1356430269c8e9c2 Mon Sep 17 00:00:00 2001 From: jzitnik-dev Date: Thu, 7 Aug 2025 00:46:04 +0200 Subject: [PATCH] fix: IDK --- scrape/scraper.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scrape/scraper.js b/scrape/scraper.js index 0577cb3..2b75ebb 100644 --- a/scrape/scraper.js +++ b/scrape/scraper.js @@ -121,9 +121,8 @@ async function clearDownloadsFolder() { } // Helper: get newest .xlsx file in downloads folder - function getNewestFile(dir, ext = '.xlsx') { + function getNewestFile(dir) { const files = fs.readdirSync(dir) - .filter(f => f.endsWith(ext)) .map(f => ({ name: f, time: fs.statSync(path.join(dir, f)).mtime.getTime() @@ -133,7 +132,7 @@ async function clearDownloadsFolder() { } // Wait for the downloaded file - const downloadedFilePath = getNewestFile(downloadPath, '.xlsx'); + const downloadedFilePath = getNewestFile(downloadPath); if (!downloadedFilePath) { throw new Error('No XLSX file found in download folder'); }