Made imdb regex ungreedy

make-only-subtitle-default
jeanchristophe.mqt@gmail.com 2 years ago
parent 3a03b7ed46
commit 86c536252a

@ -123,7 +123,7 @@ var getFileInfoFromLookup = function (args, arrApp, fileName) { return __awaiter
switch (_c.label) { switch (_c.label) {
case 0: case 0:
fInfo = { id: '-1' }; 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]; if (!(imdbId !== '')) return [3 /*break*/, 2];
return [4 /*yield*/, args.deps.axios({ return [4 /*yield*/, args.deps.axios({
method: 'get', method: 'get',

@ -126,7 +126,7 @@ const getFileInfoFromLookup = async (
) )
: Promise<IFileInfo> => { : Promise<IFileInfo> => {
let fInfo: IFileInfo = { id: '-1' }; 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 !== '') { if (imdbId !== '') {
const lookupResponse: ILookupResponse = await args.deps.axios({ const lookupResponse: ILookupResponse = await args.deps.axios({
method: 'get', method: 'get',

Loading…
Cancel
Save