Skip to content

Commit

Permalink
Adjust "popular" feed error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Oct 4, 2023
1 parent 2c7daf8 commit fe674f5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ function VideoRowListRowContentTask(input as object) as object
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
}
if response.error.instr("Closed stream") > -1
feed = contentNode.feed
if feed.items.Count() = 1 and feed.items[0].endpoint = "popular"
LogWarn("Deleting feed", contentNode.title, "-", response.error)
parent = contentNode.getParent()
parent.removeChild(contentNode)
return {
success: true
}
end if
end if

contentNode.loadState = FeedLoadState.Error
Expand Down

0 comments on commit fe674f5

Please sign in to comment.