mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-11 17:40:03 -04:00
Update scripts
This commit is contained in:
parent
8a83f23243
commit
f1d2add19a
98 changed files with 2423 additions and 1499 deletions
28
scripts/models/playlist.ts
Normal file
28
scripts/models/playlist.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import { Collection } from '../core'
|
||||
import { Stream } from '../models'
|
||||
|
||||
type PlaylistOptions = {
|
||||
public: boolean
|
||||
}
|
||||
|
||||
export class Playlist {
|
||||
streams: Collection
|
||||
options: {
|
||||
public: boolean
|
||||
}
|
||||
|
||||
constructor(streams: Collection, options?: PlaylistOptions) {
|
||||
this.streams = streams
|
||||
this.options = options || { public: false }
|
||||
}
|
||||
|
||||
toString() {
|
||||
let output = `#EXTM3U\n`
|
||||
|
||||
this.streams.forEach((stream: Stream) => {
|
||||
output += stream.toString(this.options) + `\n`
|
||||
})
|
||||
|
||||
return output
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue