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

Function removeBrokenLinks

scripts/commands/playlist/test.ts:155–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153}
154
155async function removeBrokenLinks() {
156 const streamsGrouped = streams.groupBy((stream: Stream) => stream.filepath)
157 for (const filepath of streamsGrouped.keys()) {
158 let streams: Collection<Stream> = new Collection(streamsGrouped.get(filepath))
159
160 streams = streams.filter((stream: Stream) => !isBroken(stream))
161
162 const playlist = new Playlist(streams, { public: false })
163 await rootStorage.save(filepath, playlist.toString())
164 }
165}
166
167async function onFinish(error: Error | null | undefined) {
168 clearInterval(interval)

Callers 1

onFinishFunction · 0.85

Calls 2

toStringMethod · 0.95
isBrokenFunction · 0.85

Tested by

no test coverage detected