From c6a6ce2ef0c1ca2300611f14b0548e6d0c1d2160 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 19 May 2025 19:12:06 +0300 Subject: [PATCH 1/2] Update validate.test.ts --- tests/commands/playlist/validate.test.ts | 5 +++++ 1 file changed, 5 insertions(+) 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' }) + }) }) From b0c56724a605aaed1eb04e119d273cf3078256f4 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 19 May 2025 19:12:11 +0300 Subject: [PATCH 2/2] Update playlistParser.ts --- scripts/core/playlistParser.ts | 2 ++ 1 file changed, 2 insertions(+) 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) }