Moved skipPlaylist() back to util.js

This commit is contained in:
freearhey 2019-09-09 04:02:40 +03:00
parent 06982fe724
commit 68835226ef
1 changed files with 1 additions and 14 deletions

View File

@ -41,7 +41,7 @@ async function test() {
for(let country of countries) {
if (skipPlaylist(country.url)) {
if (util.skipPlaylist(country.url)) {
continue
}
@ -114,16 +114,3 @@ function writeToLog(country, msg, url) {
util.appendToFile(errorLog, now.toISOString() + ' ' + line + '\n')
console.log(`Error: ${msg} '${url}'`)
}
function skipPlaylist(filename) {
let testCountry = process.env.npm_config_country
let excludeCountries = process.env.npm_config_exclude.split(',')
if (testCountry && filename !== 'channels/' + testCountry + '.m3u') return true
for(const countryCode of excludeCountries) {
if (filename === 'channels/' + countryCode + '.m3u') return true
}
return false
}