From 1f6e9de4ba505f83c41ff482a0d47dc69c54798e Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 8 Sep 2021 20:03:01 +0300 Subject: [PATCH] Update utils.js --- scripts/helpers/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/helpers/utils.js b/scripts/helpers/utils.js index 277bae92f..6f8c7f33c 100644 --- a/scripts/helpers/utils.js +++ b/scripts/helpers/utils.js @@ -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