Update validate.ts

This commit is contained in:
freearhey 2025-01-13 16:32:32 +03:00
parent 55a6a2fecc
commit f5f37a7441

View file

@ -50,9 +50,9 @@ async function main() {
const bufferBySiteId = new Dictionary() const bufferBySiteId = new Dictionary()
const errors: ValidationError[] = [] const errors: ValidationError[] = []
parsedChannels.forEach((channel: Channel) => { parsedChannels.forEach((channel: Channel) => {
const bufferSiteId: string = `${channel.site_id}:${channel.lang}` const bufferId: string = channel.site_id
if (bufferBySiteId.missing(bufferSiteId)) { if (bufferBySiteId.missing(bufferId)) {
bufferBySiteId.set(bufferSiteId, true) bufferBySiteId.set(bufferId, true)
} else { } else {
errors.push({ type: 'duplicate', ...channel }) errors.push({ type: 'duplicate', ...channel })
totalErrors++ totalErrors++
@ -72,16 +72,6 @@ async function main() {
errors.push({ type: 'wrong_xmltv_id', ...channel }) errors.push({ type: 'wrong_xmltv_id', ...channel })
totalErrors++ totalErrors++
} }
// if (foundChannel && foundChannel.replacedBy) {
// errors.push({ type: 'replaced', ...channel })
// totalErrors++
// }
// if (foundChannel && foundChannel.closed && !foundChannel.replacedBy) {
// errors.push({ type: 'closed', ...channel })
// totalErrors++
// }
}) })
if (errors.length) { if (errors.length) {