|
|
|
@ -7,11 +7,12 @@ module.exports = async function (streams = []) {
|
|
|
|
|
await api.countries.load()
|
|
|
|
|
const countries = await api.countries.all()
|
|
|
|
|
await api.regions.load()
|
|
|
|
|
const regions = await api.regions.all()
|
|
|
|
|
let regions = await api.regions.all()
|
|
|
|
|
regions = regions.filter(r => r.code !== 'INT')
|
|
|
|
|
await api.subdivisions.load()
|
|
|
|
|
const subdivisions = await api.subdivisions.all()
|
|
|
|
|
|
|
|
|
|
const output = []
|
|
|
|
|
let output = []
|
|
|
|
|
for (const country of countries) {
|
|
|
|
|
let countryRegionCodes = _.filter(regions, { countries: [country.code] }).map(
|
|
|
|
|
r => `r/${r.code}`
|
|
|
|
@ -40,5 +41,13 @@ module.exports = async function (streams = []) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let intItems = _.filter(streams, stream => stream.broadcast_area.includes('r/INT'))
|
|
|
|
|
output.push({
|
|
|
|
|
filepath: `countries/int.m3u`,
|
|
|
|
|
items: intItems
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
output = output.filter(f => f.items.length > 0)
|
|
|
|
|
|
|
|
|
|
return output
|
|
|
|
|
}
|
|
|
|
|