mirror of
https://github.com/iptv-org/iptv
synced 2026-04-24 11:47:13 -04:00
Update scripts
This commit is contained in:
@@ -12,6 +12,7 @@ export class Country {
|
||||
language?: Language
|
||||
subdivisions?: Collection
|
||||
regions?: Collection
|
||||
cities?: Collection
|
||||
|
||||
constructor(data?: CountryData) {
|
||||
if (!data) return
|
||||
@@ -23,15 +24,19 @@ export class Country {
|
||||
}
|
||||
|
||||
withSubdivisions(subdivisionsGroupedByCountryCode: Dictionary): this {
|
||||
this.subdivisions = subdivisionsGroupedByCountryCode.get(this.code) || new Collection()
|
||||
this.subdivisions = new Collection(subdivisionsGroupedByCountryCode.get(this.code))
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
withRegions(regions: Collection): this {
|
||||
this.regions = regions.filter(
|
||||
(region: Region) => region.code !== 'INT' && region.includesCountryCode(this.code)
|
||||
)
|
||||
this.regions = regions.filter((region: Region) => region.includesCountryCode(this.code))
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
withCities(citiesGroupedByCountryCode: Dictionary): this {
|
||||
this.cities = new Collection(citiesGroupedByCountryCode.get(this.code))
|
||||
|
||||
return this
|
||||
}
|
||||
@@ -54,6 +59,10 @@ export class Country {
|
||||
return this.subdivisions || new Collection()
|
||||
}
|
||||
|
||||
getCities(): Collection {
|
||||
return this.cities || new Collection()
|
||||
}
|
||||
|
||||
serialize(): CountrySerializedData {
|
||||
return {
|
||||
code: this.code,
|
||||
|
||||
Reference in New Issue
Block a user