|
|
|
@ -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
|
|
|
|
|