From b648f5fce8538dfe525c0eb0aeed09e0d81296b2 Mon Sep 17 00:00:00 2001 From: freearhey Date: Mon, 12 Aug 2019 15:34:56 +0300 Subject: [PATCH] Update util.js Added skipPlaylist() function --- helpers/util.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/helpers/util.js b/helpers/util.js index 1165b7971f..1e1d20f70f 100644 --- a/helpers/util.js +++ b/helpers/util.js @@ -217,6 +217,14 @@ function validateUrl(channelUrl) { return blacklist.indexOf(host) === -1 } +function skipPlaylist(filename) { + let test_country = process.env.npm_config_country + if (test_country && filename !== 'channels/' + test_country + '.m3u') { + return true; + } + return false; +} + module.exports = { parsePlaylist, sortByTitle, @@ -229,5 +237,6 @@ module.exports = { addToCache, checkCache, clearCache, - validateUrl + validateUrl, + skipPlaylist } \ No newline at end of file