diff --git a/scripts/core/playlistParser.ts b/scripts/core/playlistParser.ts index 7d388dd209..37e2896dbe 100644 --- a/scripts/core/playlistParser.ts +++ b/scripts/core/playlistParser.ts @@ -23,6 +23,8 @@ export class PlaylistParser { let streams = new Collection() for (const filepath of files) { + if (!this.storage.existsSync(filepath)) continue + const _streams: Collection = await this.parseFile(filepath) streams = streams.concat(_streams) } diff --git a/tests/commands/playlist/validate.test.ts b/tests/commands/playlist/validate.test.ts index 95f77cd9e4..fe4885b9dc 100644 --- a/tests/commands/playlist/validate.test.ts +++ b/tests/commands/playlist/validate.test.ts @@ -41,4 +41,9 @@ describe('playlist:validate', () => { ) } }) + + it('skip the file if it does not exist', () => { + const cmd = `${ENV_VAR} npm run playlist:validate -- missing.m3u` + execSync(cmd, { encoding: 'utf8' }) + }) })