Files
iptv/scripts/models/playlist.ts
2025-10-08 21:25:22 +03:00

29 lines
580 B
TypeScript

import { Collection } from '@freearhey/core'
import { Stream } from '../models'
type PlaylistOptions = {
public: boolean
}
export class Playlist {
streams: Collection<Stream>
options: {
public: boolean
}
constructor(streams: Collection<Stream>, options?: PlaylistOptions) {
this.streams = streams
this.options = options || { public: false }
}
toString() {
let output = '#EXTM3U\r\n'
this.streams.forEach((stream: Stream) => {
output += stream.toString(this.options) + '\r\n'
})
return output
}
}