From 9c8891c8db0eb6d30f03a8fa68303e26bb002714 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Sat, 31 May 2025 14:53:27 -0600 Subject: [PATCH] don't match metadata if the metadata db is empty --- server.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 6e12bdd..7cc3455 100644 --- a/server.js +++ b/server.js @@ -104,7 +104,7 @@ async function getFilesJob() { await optimizeDatabaseKws(); } //this is less important and needs to run last. - if (fileCount > oldFileCount) { + if (fileCount > oldFileCount && await Metadata.count()) { metadataManager.matchAllMetadata(true); } metadataMatchCount = await File.count({ @@ -117,7 +117,9 @@ async function updateMetadata() { if (updatingFiles) return; if ((await Metadata.count()) < (await metadataManager.getIGDBGamesCount())) { await metadataManager.syncAllMetadata(); - await metadataManager.matchAllMetadata(); + if(await Metadata.count()){ + await metadataManager.matchAllMetadata(); + } metadataMatchCount = await File.count({ where: { detailsId: { [Op.ne]: null } }, });