From 764afced49dc0640569de07049c3632104e3ab18 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 25 Apr 2022 20:08:22 +0200 Subject: [PATCH] Check title is string (#300) * Check title is string * Fix lint and brackets --- .../Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index d289f15..b892b64 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -98,7 +98,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const { index } = subStream; if (fs.existsSync(`${subsFile}`)) { response.infoLog += `${lang}.srt already exists. Skipping!\n`; - } else if (title.toLowerCase().includes('commentary') || title.toLowerCase().includes('description')) { + } else if (typeof title === 'string' + && (title.toLowerCase().includes('commentary') + || title.toLowerCase().includes('description'))) { response.infoLog += `Stream ${i} ${lang}.srt is a ${title} track. Skipping!\n`; } else { response.infoLog += `Extracting ${lang}.srt\n`;