diff --git a/scripts/commands/playlist/validate.ts b/scripts/commands/playlist/validate.ts index 8f420b8577..30bb066b90 100644 --- a/scripts/commands/playlist/validate.ts +++ b/scripts/commands/playlist/validate.ts @@ -53,7 +53,13 @@ async function main() { const log = new Collection() streams.forEach((stream: Stream) => { - if (stream.channel) { + if (!stream.channel) { + log.add({ + type: 'warning', + line: stream.getLine(), + message: `"${stream.url}" is missing a channel ID` + }) + } else { const channel = data.channelsKeyById.get(stream.channel) if (!channel) { log.add({ @@ -62,6 +68,23 @@ async function main() { message: `"${stream.tvgId}" is not in the database` }) } + + if (!stream.feed) { + log.add({ + type: 'warning', + line: stream.getLine(), + message: `"${stream.url}" is missing a feed ID` + }) + } else { + const feed = data.feedsKeyByStreamId.get(stream.getId()) + if (!feed) { + log.add({ + type: 'warning', + line: stream.getLine(), + message: `There is no feed with the ID "${stream.feed}" in the database for the "${stream.channel}" channel` + }) + } + } } const isDuplicate = stream.url && buffer.has(stream.url)