Made imdb regex ungreedy

make-only-subtitle-default
jeanchristophe.mqt@gmail.com 2 years ago
parent f9e9215bcb
commit d89af16858

@ -106,7 +106,7 @@ var getId = function (args, arrApp, fileName) { return __awaiter(void 0, void 0,
return __generator(this, function (_k) {
switch (_k.label) {
case 0:
imdbId = (_f = (_e = /\b(tt|nm|co|ev|ch|ni)\d{7,10}\b/i.exec(fileName)) === null || _e === void 0 ? void 0 : _e.at(0)) !== null && _f !== void 0 ? _f : '';
imdbId = (_f = (_e = /\b(tt|nm|co|ev|ch|ni)\d{7,10}?\b/i.exec(fileName)) === null || _e === void 0 ? void 0 : _e.at(0)) !== null && _f !== void 0 ? _f : '';
if (!(imdbId !== '')) return [3 /*break*/, 2];
_b = Number;
return [4 /*yield*/, args.deps.axios({

@ -95,7 +95,7 @@ const getId = async (
fileName: string,
)
: Promise<number> => {
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) ?? '';
let id = (imdbId !== '')
? Number((await args.deps.axios({
method: 'get',

Loading…
Cancel
Save