Allow user control of threshold

This commit is contained in:
iPromKnight
2024-02-29 21:47:07 +00:00
parent 65b8fe588b
commit 38d4e5d5ed
3 changed files with 5 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
export const metadataConfig = {
IMDB_CONCURRENT: parseInt(process.env.IMDB_CONCURRENT || "1", 10),
IMDB_INTERVAL_MS: parseInt(process.env.IMDB_INTERVAL_MS || "1000", 10)
IMDB_INTERVAL_MS: parseInt(process.env.IMDB_INTERVAL_MS || "1000", 10),
TITLE_MATCH_THRESHOLD: Number(process.env.TITLE_MATCH_THRESHOLD || 0.25),
};

View File

@@ -13,7 +13,7 @@ import mongoose from 'mongoose';
const fuseOptions : IFuseOptions<IImdbEntry> = {
includeScore: true,
keys: ['PrimaryTitle', 'OriginalTitle'],
threshold: 0.25,
threshold: configurationService.metadataConfig.TITLE_MATCH_THRESHOLD,
};
@injectable()