MCPcopy
hub / github.com/iptv-org/iptv / parseFile

Method parseFile

scripts/core/playlistParser.ts:31–44  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

29 }
30
31 async parseFile(filepath: string): Promise<Collection<Stream>> {
32 const content = await this.storage.load(filepath)
33 const parsed: parser.Playlist = parser.parse(content)
34
35 const streams = new Collection<Stream>()
36 parsed.items.forEach((data: parser.PlaylistItem) => {
37 const stream = Stream.fromPlaylistItem(data)
38 stream.filepath = filepath
39
40 streams.add(stream)
41 })
42
43 return streams
44 }
45}

Callers 2

mainFunction · 0.95
parseMethod · 0.95

Calls 2

fromPlaylistItemMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected