mirror of
https://github.com/iptv-org/iptv
synced 2025-12-17 02:47:33 -05:00
Update scripts
This commit is contained in:
@@ -26,8 +26,15 @@ export class IndexRegionGenerator implements Generator {
|
|||||||
let groupedStreams = new Collection()
|
let groupedStreams = new Collection()
|
||||||
this.streams
|
this.streams
|
||||||
.orderBy((stream: Stream) => stream.getTitle())
|
.orderBy((stream: Stream) => stream.getTitle())
|
||||||
.filter((stream: Stream) => stream.isSFW() && !stream.isInternational())
|
.filter((stream: Stream) => stream.isSFW())
|
||||||
.forEach((stream: Stream) => {
|
.forEach((stream: Stream) => {
|
||||||
|
if (stream.isInternational()) {
|
||||||
|
const streamClone = stream.clone()
|
||||||
|
streamClone.groupTitle = 'International'
|
||||||
|
groupedStreams.push(streamClone)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!stream.hasBroadcastArea()) {
|
if (!stream.hasBroadcastArea()) {
|
||||||
const streamClone = stream.clone()
|
const streamClone = stream.clone()
|
||||||
streamClone.groupTitle = 'Undefined'
|
streamClone.groupTitle = 'Undefined'
|
||||||
@@ -43,7 +50,8 @@ export class IndexRegionGenerator implements Generator {
|
|||||||
})
|
})
|
||||||
|
|
||||||
groupedStreams = groupedStreams.orderBy((stream: Stream) => {
|
groupedStreams = groupedStreams.orderBy((stream: Stream) => {
|
||||||
if (stream.groupTitle === 'Undefined') return 'ZZ'
|
if (stream.groupTitle === 'International') return 'ZZ'
|
||||||
|
if (stream.groupTitle === 'Undefined') return 'ZZZ'
|
||||||
return stream.groupTitle
|
return stream.groupTitle
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -109,12 +109,18 @@ export class Feed {
|
|||||||
|
|
||||||
this.broadcastRegionCodes.forEach((code: string) => {
|
this.broadcastRegionCodes.forEach((code: string) => {
|
||||||
const region: Region = regionsGroupedByCode.get(code)
|
const region: Region = regionsGroupedByCode.get(code)
|
||||||
broadcastCountries = broadcastCountries.concat(region.countryCodes)
|
if (region) {
|
||||||
|
region.countryCodes.forEach((countryCode: string) => {
|
||||||
|
broadcastCountries.add(countriesGroupedByCode.get(countryCode))
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.broadcastSubdivisionCodes.forEach((code: string) => {
|
this.broadcastSubdivisionCodes.forEach((code: string) => {
|
||||||
const subdivision: Subdivision = subdivisionsGroupedByCode.get(code)
|
const subdivision: Subdivision = subdivisionsGroupedByCode.get(code)
|
||||||
broadcastCountries.add(countriesGroupedByCode.get(subdivision.countryCode))
|
if (subdivision) {
|
||||||
|
broadcastCountries.add(countriesGroupedByCode.get(subdivision.countryCode))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.broadcastCountries = broadcastCountries.uniq().filter(Boolean)
|
this.broadcastCountries = broadcastCountries.uniq().filter(Boolean)
|
||||||
|
|||||||
Reference in New Issue
Block a user