mirror of
https://github.com/iptv-org/iptv
synced 2025-12-16 10:26:48 -05:00
Update scripts
This commit is contained in:
@@ -99,6 +99,7 @@ export class DataProcessor {
|
||||
.withCities(citiesGroupedBySubdivisionCode)
|
||||
.withCountry(countriesKeyByCode)
|
||||
.withRegions(regions)
|
||||
.withParent(subdivisionsKeyByCode)
|
||||
)
|
||||
subdivisionsKeyByCode = subdivisions.keyBy((subdivision: Subdivision) => subdivision.code)
|
||||
subdivisionsGroupedByCountryCode = subdivisions.groupBy(
|
||||
|
||||
@@ -31,6 +31,10 @@ export class BroadcastArea {
|
||||
const city: City = citiesKeyByCode.get(code)
|
||||
if (!city) return
|
||||
citiesIncluded.add(city)
|
||||
if (city.subdivision) subdivisionsIncluded.add(city.subdivision)
|
||||
if (city.subdivision && city.subdivision.parent)
|
||||
subdivisionsIncluded.add(city.subdivision.parent)
|
||||
if (city.country) countriesIncluded.add(city.country)
|
||||
regionsIncluded = regionsIncluded.concat(city.getRegions())
|
||||
break
|
||||
}
|
||||
@@ -38,6 +42,7 @@ export class BroadcastArea {
|
||||
const subdivision: Subdivision = subdivisionsKeyByCode.get(code)
|
||||
if (!subdivision) return
|
||||
subdivisionsIncluded.add(subdivision)
|
||||
if (subdivision.country) countriesIncluded.add(subdivision.country)
|
||||
regionsIncluded = regionsIncluded.concat(subdivision.getRegions())
|
||||
break
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ export class Subdivision {
|
||||
countryCode: string
|
||||
country?: Country
|
||||
parentCode?: string
|
||||
parent?: Subdivision
|
||||
regions?: Collection
|
||||
cities?: Collection
|
||||
|
||||
@@ -40,6 +41,14 @@ export class Subdivision {
|
||||
return this
|
||||
}
|
||||
|
||||
withParent(subdivisionsKeyByCode: Dictionary): this {
|
||||
if (!this.parentCode) return this
|
||||
|
||||
this.parent = subdivisionsKeyByCode.get(this.parentCode)
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
getRegions(): Collection {
|
||||
if (!this.regions) return new Collection()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user