mirror of
https://github.com/iptv-org/epg
synced 2026-03-21 19:30:52 -04:00
Update edit.ts
This commit is contained in:
@@ -85,8 +85,7 @@ export default async function main(filepath: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function selectChannel(channel: epgGrabber.Channel): Promise<string> {
|
async function selectChannel(channel: epgGrabber.Channel): Promise<string> {
|
||||||
const query = escapeRegex(channel.name)
|
const similarChannels = searchChannels(channel.name)
|
||||||
const similarChannels = searchChannels(query)
|
|
||||||
const choices = getChoicesForChannel(similarChannels).all()
|
const choices = getChoicesForChannel(similarChannels).all()
|
||||||
|
|
||||||
const selected: ChoiceValue = await select({
|
const selected: ChoiceValue = await select({
|
||||||
@@ -194,7 +193,3 @@ function save(filepath: string, channelsFromXML: Collection<Channel>) {
|
|||||||
console.log()
|
console.log()
|
||||||
logger.info(`File '${filepath}' successfully saved`)
|
logger.info(`File '${filepath}' successfully saved`)
|
||||||
}
|
}
|
||||||
|
|
||||||
function escapeRegex(string: string) {
|
|
||||||
return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&')
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user