Update scripts

This commit is contained in:
freearhey
2026-05-25 13:29:39 +03:00
parent b7cd2a1d5a
commit 254458135a
6 changed files with 86 additions and 36 deletions
+9 -1
View File
@@ -81,6 +81,10 @@ async function loadStreams() {
const files = await streamsStorage.list('**/*.m3u')
streams = await parser.parse(files)
streams = streams.map((stream: Stream) => {
stream.setGuides(apiData.guidesGroupedByStreamId.get(stream.getId()))
return stream
})
}
async function processIssues(issues: Collection<Issue>) {
@@ -132,7 +136,7 @@ async function removeStream(issue: Issue) {
if (changed) {
processedIssues.add(issue)
} else {
log.error(`None of the URLs specified in the request were found in the playlists`)
log.error('None of the URLs specified in the request were found in the playlists')
skippedIssues.add(issue)
}
}
@@ -162,6 +166,8 @@ async function editStream(issue: Issue) {
stream.updateWithIssue(data)
stream.setGuides(apiData.guidesGroupedByStreamId.get(stream.getId()))
const errors = new Collection<Error>()
errors.concat(stream.validate())
if (errors.isNotEmpty()) {
@@ -260,6 +266,8 @@ async function addStream(issue: Issue) {
stream.updateTitle().updateFilepath()
stream.setGuides(apiData.guidesGroupedByStreamId.get(stream.getId()))
streams.add(stream)
const errors = new Collection<Error>()