From aca903a668b1517c751a9fb69bb02ea10ab59f44 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 26 Aug 2022 06:40:38 +0300 Subject: [PATCH] Update editor.js --- scripts/commands/channels/editor.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/commands/channels/editor.js b/scripts/commands/channels/editor.js index c838b72e..3d679c12 100644 --- a/scripts/commands/channels/editor.js +++ b/scripts/commands/channels/editor.js @@ -20,9 +20,13 @@ async function main() { let result = await parser.parseChannels(options.input) site = result.site channels = result.channels + channels = channels.map(c => { + c.xmltv_id = c.id + return c + }) await api.channels.load() for (const channel of channels) { - if (channel.id) continue + if (channel.xmltv_id) continue let choices = await getOptions(channel) const question = { name: 'option', @@ -35,17 +39,17 @@ async function main() { switch (selected.option) { case 'Overwrite...': const input = await getInput(channel) - channel.id = input.xmltv_id + channel.xmltv_id = input.xmltv_id break case 'Skip...': - channel.id = '-' + channel.xmltv_id = '-' break default: const [name, xmltv_id] = selected.option .replace(/ \[.*\]/, '') .split('|') .map(i => i.trim().replace(newLabel, '')) - channel.id = xmltv_id + channel.xmltv_id = xmltv_id break } })