Update scripts

This commit is contained in:
freearhey committed 2023-10-02 06:31:57 +03:00
1 parent b7214db4fb
commit ca254a6df0
37 files changed
+1091 -915

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import { parseChannels } from 'epg-grabber'
import { Storage, Collection } from '@freearhey/core'
type ChannelsParserProps = {
storage: Storage
}
export class ChannelsParser {
storage: Storage
constructor({ storage }: ChannelsParserProps) {
this.storage = storage
}
async parse(filepath: string) {
let parsedChannels = new Collection()
const content = await this.storage.load(filepath)
const channels = parseChannels(content)
parsedChannels = parsedChannels.concat(new Collection(channels))
return parsedChannels
}
}