Update utils.js
This commit is contained in:
parent
0deaf545d0
commit
1f6e9de4ba
|
@ -74,17 +74,17 @@ utils.removeProtocol = function (string) {
|
|||
return string.replace(/(^\w+:|^)\/\//, '')
|
||||
}
|
||||
|
||||
utils.filterPlaylists = function (arr, include = '', exclude = '') {
|
||||
utils.filterFiles = function (arr, include = '', exclude = '') {
|
||||
if (include) {
|
||||
const included = include.split(',').map(filename => `channels/${filename}.m3u`)
|
||||
|
||||
return arr.filter(i => included.indexOf(i.url) > -1)
|
||||
return arr.filter(filename => included.includes(filename))
|
||||
}
|
||||
|
||||
if (exclude) {
|
||||
const excluded = exclude.split(',').map(filename => `channels/${filename}.m3u`)
|
||||
|
||||
return arr.filter(i => excluded.indexOf(i.url) === -1)
|
||||
return arr.filter(filename => !excluded.includes(filename))
|
||||
}
|
||||
|
||||
return arr
|
||||
|
|
Loading…
Reference in New Issue