Check title is string (#300)

* Check title is string

* Fix lint and brackets
make-only-subtitle-default
HaveAGitGat 4 years ago committed by GitHub
parent d593eb312d
commit 764afced49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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`;

Loading…
Cancel
Save