Files
epg/scripts/core/channelsParser.ts

23 lines
538 B
TypeScript
Raw Normal View History

2025-10-24 15:09:57 +02:00
import { EPGGrabber } from 'epg-grabber'
import { Storage } from '@freearhey/storage-js'
import { ChannelList } from '../models'
interface ChannelsParserProps {
storage: Storage
}
export class ChannelsParser {
storage: Storage
constructor({ storage }: ChannelsParserProps) {
this.storage = storage
}
async parse(filepath: string): Promise<ChannelList> {
const content = await this.storage.load(filepath)
2025-10-24 15:09:57 +02:00
const parsed = EPGGrabber.parseChannelsXML(content)
return new ChannelList({ channels: parsed })
}
}