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

@@ -48,6 +48,8 @@ UDP_TRACKERS_ENABLED=true
CONSUMER_REPLICAS=3
## Fix for #66 - toggle on for development
AUTO_CREATE_AND_APPLY_MIGRATIONS=false
## Allows control of the threshold for matching titles to the IMDB dataset. The closer to 0, the more strict the matching.
TITLE_MATCH_THRESHOLD=0.25
# Producer
GITHUB_PAT=

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