Update scripts

This commit is contained in:
freearhey
2025-08-24 22:43:25 +03:00
parent b85eca12be
commit 8f9ea06133
21 changed files with 453 additions and 275 deletions

View File

@@ -1,4 +1,4 @@
import { Country, Language, Region, Channel, Subdivision, BroadcastArea } from './index'
import { Country, Language, Region, Channel, Subdivision, BroadcastArea, City } from './index'
import { Collection, Dictionary } from '@freearhey/core'
import type { FeedData } from '../types/feed'
@@ -120,6 +120,12 @@ export class Feed {
)
}
isBroadcastInCity(city: City): boolean {
if (!this.broadcastArea) return false
return this.broadcastArea.includesCity(city)
}
isBroadcastInSubdivision(subdivision: Subdivision): boolean {
if (!this.broadcastArea) return false
@@ -129,13 +135,19 @@ export class Feed {
isBroadcastInCountry(country: Country): boolean {
if (!this.broadcastArea) return false
return this.broadcastArea?.includesCountry(country)
return this.broadcastArea.includesCountry(country)
}
isBroadcastInRegion(region: Region): boolean {
if (!this.broadcastArea) return false
return this.broadcastArea?.includesRegion(region)
return this.broadcastArea.includesRegion(region)
}
isInternational(): boolean {
if (!this.broadcastArea) return false
return this.broadcastArea.codes.join(',').includes('r/')
}
getGuides(): Collection {