Moved skipPlaylist() back to util.js
This commit is contained in:
parent
06982fe724
commit
68835226ef
|
@ -41,7 +41,7 @@ async function test() {
|
||||||
|
|
||||||
for(let country of countries) {
|
for(let country of countries) {
|
||||||
|
|
||||||
if (skipPlaylist(country.url)) {
|
if (util.skipPlaylist(country.url)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,16 +114,3 @@ function writeToLog(country, msg, url) {
|
||||||
util.appendToFile(errorLog, now.toISOString() + ' ' + line + '\n')
|
util.appendToFile(errorLog, now.toISOString() + ' ' + line + '\n')
|
||||||
console.log(`Error: ${msg} '${url}'`)
|
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
|
|
||||||
}
|
|
Loading…
Reference in New Issue