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,14 @@
import { Feed, Channel, Category, Region, Subdivision, Country, Language, Logo } from './index'
import {
Feed,
Channel,
Category,
Region,
Subdivision,
Country,
Language,
Logo,
City
} from './index'
import { URL, Collection, Dictionary } from '@freearhey/core'
import type { StreamData } from '../types/stream'
import parser from 'iptv-playlist-parser'
@@ -330,6 +340,10 @@ export class Stream {
return this.feed ? this.feed.broadcastAreaCodes : new Collection()
}
isBroadcastInCity(city: City): boolean {
return this.feed ? this.feed.isBroadcastInCity(city) : false
}
isBroadcastInSubdivision(subdivision: Subdivision): boolean {
return this.feed ? this.feed.isBroadcastInSubdivision(subdivision) : false
}
@@ -342,6 +356,10 @@ export class Stream {
return this.feed ? this.feed.isBroadcastInRegion(region) : false
}
isInternational(): boolean {
return this.feed ? this.feed.isInternational() : false
}
getLogos(): Collection {
function format(logo: Logo): number {
const levelByFormat = { SVG: 0, PNG: 3, APNG: 1, WebP: 1, AVIF: 1, JPEG: 2, GIF: 1 }