Update edit.ts

This commit is contained in:
freearhey
2026-03-11 04:32:38 +03:00
parent 97010e1c55
commit f885492a22

View File

@@ -85,8 +85,7 @@ export default async function main(filepath: string) {
}
async function selectChannel(channel: epgGrabber.Channel): Promise<string> {
const query = escapeRegex(channel.name)
const similarChannels = searchChannels(query)
const similarChannels = searchChannels(channel.name)
const choices = getChoicesForChannel(similarChannels).all()
const selected: ChoiceValue = await select({
@@ -194,7 +193,3 @@ function save(filepath: string, channelsFromXML: Collection<Channel>) {
console.log()
logger.info(`File '${filepath}' successfully saved`)
}
function escapeRegex(string: string) {
return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&')
}