Update scripts

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

28
scripts/core/xmltv.ts Normal file
View file

@ -0,0 +1,28 @@
import { DateTime, Collection } from '@freearhey/core'
import { generateXMLTV } from 'epg-grabber'
type XMLTVProps = {
channels: Collection
programs: Collection
date: DateTime
}
export class XMLTV {
channels: Collection
programs: Collection
date: DateTime
constructor({ channels, programs, date }: XMLTVProps) {
this.channels = channels
this.programs = programs
this.date = date
}
toString() {
return generateXMLTV({
channels: this.channels.all(),
programs: this.programs.all(),
date: this.date.toJSON()
})
}
}