From 970c0d40ea1dfbf818fb5fd3f951a6d65a442dca Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 6 Oct 2021 05:16:02 +0300 Subject: [PATCH] Update grab.js --- scripts/grab.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/grab.js b/scripts/grab.js index c91ec2c2..640e97f0 100644 --- a/scripts/grab.js +++ b/scripts/grab.js @@ -17,7 +17,14 @@ const options = program.opts() async function main() { console.log('Starting...') - const channels = parseChannels(options.channels) + const buffer = {} + const channels = parseChannels(options.channels).filter(channel => { + if (!buffer[channel.xmltv_id]) { + buffer[channel.xmltv_id] = true + return true + } + return false + }) console.log('Parsing:') let programs = []