Installed escape-string-regexp

This commit is contained in:
freearhey committed 2019-10-23 13:52:01 +03:00
1 parent 4d0f77f79e
commit e00d74ad86
3 files changed
+9

No files matched your search

+2
View File
@@ -1,4 +1,5 @@
const util = require('./util')
const escapeStringRegexp = require('escape-string-regexp')
const debug = false
const verbose = false
@@ -83,6 +84,7 @@ async function main() {
for(let channelId in buffer[epgUrl].channels) {
let c = buffer[epgUrl].channels[channelId]
for(let epgName of c.names) {
epgName = escapeStringRegexp(epgName)
channelTitle = channel.title.replace(/(fhd|hd|sd|高清)$/i, '').trim()
let regexp = new RegExp(`^${epgName}$`, 'i')
if(regexp.test(channelTitle)) {