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

+1
View File
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- (potentionally) a bug where many dialogs could cause an execution timeout
- Mutltiple rare crashes when component content is set before component initialization
- Error dialog for loading "Popular" when "Popular" is disabled
## [0.13.0] - 2023-10-02
@@ -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