Handle Popular disabled case (#162)

This commit is contained in:
Brahim Hadriche authored and GitHub committed 2023-10-04 18:52:44 -04:00
1 parent e8fd7ee35d
commit 6abd18ab85
2 files changed
+13

No files matched your search

@@ -36,6 +36,18 @@ function VideoRowListRowContentTask(input as object) as object
success: true
}
end if
' Invidious returns 500 and "{"error":"Closed stream"}" when the Popular feed is disabled
' TODO:P2 check the endpoint.name instead of contentNode.title to avoid conflict with other feeds
if contentNode.title = "Popular" and response.error.instr("Closed stream") > 0
LogWarn("Deleting feed", contentNode.title, "-", response.error)
parent = contentNode.getParent()
parent.removeChild(contentNode)
return {
success: true
}
end if
contentNode.loadState = FeedLoadState.Error
contentNode.title += " (Failed to load)"
return response