mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-11 17:40:03 -04:00
Update update.ts
This commit is contained in:
parent
1fb459d5c5
commit
03abe758e9
1 changed files with 13 additions and 6 deletions
|
@ -54,13 +54,20 @@ async function removeStreams(loader: IssueLoader) {
|
|||
const issues = await loader.load({ labels: ['streams:remove', 'approved'] })
|
||||
issues.forEach((issue: Issue) => {
|
||||
const data = issue.data
|
||||
if (data.missing('stream_url')) return
|
||||
if (data.missing('broken_links')) return
|
||||
|
||||
const found: Stream = streams.first((_stream: Stream) => _stream.url === data.get('stream_url'))
|
||||
if (found) {
|
||||
found.removed = true
|
||||
processedIssues.add(issue.number)
|
||||
}
|
||||
const brokenLinks = data.get('broken_links').split(/\r?\n/).filter(Boolean)
|
||||
|
||||
let changed = false
|
||||
brokenLinks.forEach(link => {
|
||||
const found: Stream = streams.first((_stream: Stream) => _stream.url === link.trim())
|
||||
if (found) {
|
||||
found.removed = true
|
||||
changed = true
|
||||
}
|
||||
})
|
||||
|
||||
if (changed) processedIssues.add(issue.number)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue