mirror of
https://github.com/iptv-org/iptv
synced 2026-09-09 13:27:58 -04:00
Update validate.ts
This commit is contained in:
@@ -53,7 +53,13 @@ async function main() {
|
|||||||
|
|
||||||
const log = new Collection<LogItem>()
|
const log = new Collection<LogItem>()
|
||||||
streams.forEach((stream: Stream) => {
|
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)
|
const channel = data.channelsKeyById.get(stream.channel)
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
log.add({
|
log.add({
|
||||||
@@ -62,6 +68,23 @@ async function main() {
|
|||||||
message: `"${stream.tvgId}" is not in the database`
|
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)
|
const isDuplicate = stream.url && buffer.has(stream.url)
|
||||||
|
|||||||
Reference in New Issue
Block a user