Skip to content

Commit 9c8891c

Browse files
committed
don't match metadata if the metadata db is empty
1 parent ab623cb commit 9c8891c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async function getFilesJob() {
104104
await optimizeDatabaseKws();
105105
}
106106
//this is less important and needs to run last.
107-
if (fileCount > oldFileCount) {
107+
if (fileCount > oldFileCount && await Metadata.count()) {
108108
metadataManager.matchAllMetadata(true);
109109
}
110110
metadataMatchCount = await File.count({
@@ -117,7 +117,9 @@ async function updateMetadata() {
117117
if (updatingFiles) return;
118118
if ((await Metadata.count()) < (await metadataManager.getIGDBGamesCount())) {
119119
await metadataManager.syncAllMetadata();
120-
await metadataManager.matchAllMetadata();
120+
if(await Metadata.count()){
121+
await metadataManager.matchAllMetadata();
122+
}
121123
metadataMatchCount = await File.count({
122124
where: { detailsId: { [Op.ne]: null } },
123125
});

0 commit comments

Comments
 (0)