Fix empty channels showing up as errored with RSS #3824
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Fix empty channels showing up as errored with RSS
Pull Request Type
Related issue
closes #3800
Description
As we switched from the channel RSS feeds to the playlist ones, we also need to update the logic to handle empty and terminated channels. For empty channels the channel RSS feed returns an empty feed and only 404s if the channel doesn't exist e.g. it was terminated, unfortunately YouTube only creates the auto-generated playlists if the channel has the relevant tabs/content of that type, so it will 404 even if the channel still exists. To ensure that we only show errors for actually terminated and deleted channels, this pull request will fire off a HEAD request to the channel RSS feed if the playlist one 404s, that way we can supress the playlist 404s if they aren't actual errors.
I also took the opportunity to fix the CSS for the errored channels section.
This only addresses the local API, Invidious with RSS won't show any errors, even for terminated channels, due to iv-org/invidious#4021
Screenshots
before:

after:

Testing
For testing purposes I've made a profiles database with 3 channels:
profiles.dbprofiles.txt%appdata%\Electron\profiles.dbyarn devoryarn run dev)