mirror of
https://github.com/iptv-org/iptv
synced 2026-09-06 03:50:47 -04:00
Update validate.ts
This commit is contained in:
@@ -53,7 +53,13 @@ async function main() {
|
||||
|
||||
const log = new Collection<LogItem>()
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user