mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Update editor.js
This commit is contained in:
parent
59980ed779
commit
aca903a668
1 changed files with 8 additions and 4 deletions
|
@ -20,9 +20,13 @@ async function main() {
|
||||||
let result = await parser.parseChannels(options.input)
|
let result = await parser.parseChannels(options.input)
|
||||||
site = result.site
|
site = result.site
|
||||||
channels = result.channels
|
channels = result.channels
|
||||||
|
channels = channels.map(c => {
|
||||||
|
c.xmltv_id = c.id
|
||||||
|
return c
|
||||||
|
})
|
||||||
await api.channels.load()
|
await api.channels.load()
|
||||||
for (const channel of channels) {
|
for (const channel of channels) {
|
||||||
if (channel.id) continue
|
if (channel.xmltv_id) continue
|
||||||
let choices = await getOptions(channel)
|
let choices = await getOptions(channel)
|
||||||
const question = {
|
const question = {
|
||||||
name: 'option',
|
name: 'option',
|
||||||
|
@ -35,17 +39,17 @@ async function main() {
|
||||||
switch (selected.option) {
|
switch (selected.option) {
|
||||||
case 'Overwrite...':
|
case 'Overwrite...':
|
||||||
const input = await getInput(channel)
|
const input = await getInput(channel)
|
||||||
channel.id = input.xmltv_id
|
channel.xmltv_id = input.xmltv_id
|
||||||
break
|
break
|
||||||
case 'Skip...':
|
case 'Skip...':
|
||||||
channel.id = '-'
|
channel.xmltv_id = '-'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
const [name, xmltv_id] = selected.option
|
const [name, xmltv_id] = selected.option
|
||||||
.replace(/ \[.*\]/, '')
|
.replace(/ \[.*\]/, '')
|
||||||
.split('|')
|
.split('|')
|
||||||
.map(i => i.trim().replace(newLabel, ''))
|
.map(i => i.trim().replace(newLabel, ''))
|
||||||
channel.id = xmltv_id
|
channel.xmltv_id = xmltv_id
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue