Made imdb regex ungreedy

This commit is contained in:
jeanchristophe.mqt@gmail.com 2024-04-12 10:18:26 +02:00
parent 3a03b7ed46
commit 86c536252a
2 changed files with 2 additions and 2 deletions

View file

@ -123,7 +123,7 @@ var getFileInfoFromLookup = function (args, arrApp, fileName) { return __awaiter
switch (_c.label) {
case 0:
fInfo = { id: '-1' };
imdbId = (_b = (_a = /\b(tt|nm|co|ev|ch|ni)\d{7,10}\b/i.exec(fileName)) === null || _a === void 0 ? void 0 : _a.at(0)) !== null && _b !== void 0 ? _b : '';
imdbId = (_b = (_a = /\b(tt|nm|co|ev|ch|ni)\d{7,10}?\b/i.exec(fileName)) === null || _a === void 0 ? void 0 : _a.at(0)) !== null && _b !== void 0 ? _b : '';
if (!(imdbId !== '')) return [3 /*break*/, 2];
return [4 /*yield*/, args.deps.axios({
method: 'get',

View file

@ -126,7 +126,7 @@ const getFileInfoFromLookup = async (
)
: Promise<IFileInfo> => {
let fInfo: IFileInfo = { id: '-1' };
const imdbId = /\b(tt|nm|co|ev|ch|ni)\d{7,10}\b/i.exec(fileName)?.at(0) ?? '';
const imdbId = /\b(tt|nm|co|ev|ch|ni)\d{7,10}?\b/i.exec(fileName)?.at(0) ?? '';
if (imdbId !== '') {
const lookupResponse: ILookupResponse = await args.deps.axios({
method: 'get',