Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Inconsistent handling of empty channel tabs #3814

Open
absidue opened this issue May 20, 2023 · 6 comments · May be fixed by #4413
Open

[Bug] Inconsistent handling of empty channel tabs #3814

absidue opened this issue May 20, 2023 · 6 comments · May be fixed by #4413
Labels
bug Something isn't working module:channels

Comments

@absidue
Copy link
Contributor

absidue commented May 20, 2023

Describe the bug
A channel tab being empty is handled differently depending on the tab. The playlists tab displays nothing on the website and returns an empty API response {"playlists":[],"continuation":null}, the community tab however shows This channel hasn't posted yet on the website and returns a HTTP 500 API response with this error: {"error":"This channel hasn't posted yet"}.

It's weird that Invidious treats the playlists tab being empty as okay, but the community tab being empty as an error. The This channel hasn't posted yet is displayed on YouTube too, however Invidious happily ignores the This channel has no playlists. message on the playlists tab.

Steps to Reproduce
Webpage:

  1. Visit {instance}/channel/UCUKPG1-r4WFyxpyhIuCs86Q/playlists
  2. Visit {instance}/channel/UCUKPG1-r4WFyxpyhIuCs86Q/community
  3. Compare the pages

API:

  1. Visit {instance}/api/v1/channels/UCUKPG1-r4WFyxpyhIuCs86Q/playlists
  2. Visit {instance}/api/v1/channels/UCUKPG1-r4WFyxpyhIuCs86Q/community
  3. Compare the responses

Screenshots
Playlists tab:
web-playlists

Community tab:
web-community

@SamantazFox
Copy link
Member

For the community tab, that's an "error" returned by youtube's API. In addition, the community tab still relies on older code, which hasn't been cleaned, so it isn't handled the same way as the others.

@absidue
Copy link
Contributor Author

absidue commented May 22, 2023

If that error is expected, does that mean you'll be returning errors for the other channel tab endpoints too or is the goal to have the community tab API endpoint behave the same as the other ones and return an empty response?

Ideally from an API user's perspective, it would be best to only return errors if there is an actual error, an empty channel tab is normal on YouTube, so shouldn't return an error. Would also align it with the behaviour of other endpoints e.g. you don't return an error when there are no search results for a search query.

@SamantazFox
Copy link
Member

SamantazFox commented May 25, 2023

Yes, I agree with you here: the community endpoint shouldn't give an error if there is no posts.
The plan if to return an empty array like for the other tabs.

@syeopite
Copy link
Member

I'm not sure if I agree with just returning an empty array. Invidious should display some kind of message when the tab is empty instead of just having it be blank imo.

@SamantazFox
Copy link
Member

SamantazFox commented Feb 14, 2024

@syeopite We were talking about the API. Regarding the frontend, I agree with you!
Edit: And by extension, we should also show messages for no playlists/videos (in the same fashion as the "no search results" message).

@ChunkyProgrammer
Copy link
Contributor

Playlist tab doesn't seem to be showing anymore for that channel so I guess YouTube fixed that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:channels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants