Improve regex to actually match IMDB ids (#196)

make-only-subtitle-default
Rick Meijer 4 years ago committed by GitHub
parent 621998d8b8
commit b797c50b31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,7 +10,7 @@ const details = () => ({
(requires TMDB api key) and English. (requires TMDB api key) and English.
'Native' languages are the ones that are listed on imdb. It does an API call to 'Native' languages are the ones that are listed on imdb. It does an API call to
Radarr, Sonarr to check if the movie/series exists and grabs the IMDB id. As a last resort it Radarr, Sonarr to check if the movie/series exists and grabs the IMDB id. As a last resort it
falls back to '[imdb-ttDIGITS] in the filename.`, falls back to the IMDB id in the filename.`,
Version: '1.00', Version: '1.00',
Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/' Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/'
+ 'Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js', + 'Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js',
@ -139,7 +139,7 @@ const tmdbApi = async (filename, api_key, axios) => {
if (filename.substr(0, 2) === 'tt') { if (filename.substr(0, 2) === 'tt') {
fileName = filename; fileName = filename;
} else { } else {
const idRegex = /\[imdb-(tt\d*)]/; const idRegex = /tt\d*/;
const fileMatch = filename.match(idRegex); const fileMatch = filename.match(idRegex);
// eslint-disable-next-line prefer-destructuring // eslint-disable-next-line prefer-destructuring
if (fileMatch) fileName = fileMatch[1]; if (fileMatch) fileName = fileMatch[1];

Loading…
Cancel
Save