FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Add ability to see comment replies of community posts through invidious

Open ChunkyProgrammer opened this issue 1 year ago • 4 comments

Add ability to see comment replies of community posts through invidious

Pull Request Type

  • [x] Feature Implementation

Related issue

#3253 (invidious only)

Description

This PR will allow for viewing community posts and their comments through FreeTube when using the Invidious API

Screenshots

  • Community tab (notice that the icon for the comments is a different color now since it's a link) image

  • community post page image

  • community post page with comments image

Testing

Channel Page:

  • go to a channel (with invidious enabled/backend fallback)

  • click community tab

  • click "comments" icon

  • go to post page

  • go to a channel (with local api enabled + no backend fallback)

  • click community tab

  • comments icon not clickable

Direct link

  • go to a post link with invidious enabled by putting the link in the search bar (ex: https://yt.artemislena.eu/post/UgkxhcOTXqzOaLBHfCQ-_-6JxsdydwSeFTei)

  • see post page

  • go to a post link with invidious disabled by putting the link in the search bar (ex: https://yt.artemislena.eu/post/UgkxhcOTXqzOaLBHfCQ-_-6JxsdydwSeFTei)

  • see message saying post can only be viewed with invidious enabled

Comments

  • view comments
  • load replies
  • load more replies
  • load more comments

Desktop

  • OS: Linux Mint
  • OS Version: 22 Cinnamon
  • FreeTube version: latest nightly

Additional context

  • I will rebase this PR with changes from #5569 once that pr is merged
  • I didn't want to rename the comment component (which is now more than just watch-video-comments) until #3559 is merged to simplify things for me

ChunkyProgrammer avatar Aug 19 '24 23:08 ChunkyProgrammer

Fetching comments seems to be broken when the preferred API backend is set to the local API and backend fallback is enabled: no-comments-error

Switching the preferred backend to the Invidious API fetches the comments correctly.

absidue avatar Aug 28 '24 21:08 absidue

If I take your example URL and replace the domain with www.youtube.com, I get redirected to here https://www.youtube.com/channel/UCRELfrtyz_teOEQXjF04BIA/community?lb=UgkxhcOTXqzOaLBHfCQ-_-6JxsdydwSeFTei. It would be great if this URL format were supported too, as all the information that is needed is already there (channel ID and post ID).

Can probably be handled by adding an if-else that checks for the lb query parameter inside the community case inside the existing channel URL parsing.

absidue avatar Aug 28 '24 21:08 absidue

Auto Load Next Page doesn't work on these?

PikachuEXE avatar Aug 29 '24 03:08 PikachuEXE

Auto Load Next Page doesn't work on these?

Should work now

ChunkyProgrammer avatar Aug 29 '24 04:08 ChunkyProgrammer

Comments is 0 when user is on the page of the post VirtualBoxVM_RuRAnUS8Cn.mp4

Not sure if this is possible but maybe worth pointing out. On YT users can go to the post by clicking on the post image or clicking on the comments icon. Should we also implement clicking on the post to go to the post page? firefox_pgPpCyUbsm.mp4

  • I've hidden the comment count on the post page (we can only get the comment count once comments are fetched)
  • I'm not sure about making it bring you to the post page when you click an image attachment since it's not consistent with other attachments (clicking a video brings you to the video, clicking a playlist brings you to a playlist, etc.)

ChunkyProgrammer avatar Sep 02 '24 13:09 ChunkyProgrammer

I've hidden the comment count on the post page (we can only get the comment count once comments are fetched)

Could you elaborate some more on this? I dont understand why we need to hide it when the data was already provided before the user went into the post

It currently makes another API request to fetch the post regardless of whether you clicked on an existing post or pasted in a link to a post, YouTube doesn't seem to have that information on the post page either (well it's in the comments section not the post body there), so maybe it's not in the API response for the post.

One potential workaround would be to implement something similar to what FreeTube currently does for playlists, where if you go from the playlist page to the watch page, it saves the playlist in the store and then retrieves it again on the watch page. That would avoid one API request and make it possible to show the comment count, of course only if the user got to the post from somewhere else in the app, if you paste in a link it would still have to make the API request and wouldn't have the comment count.

absidue avatar Sep 02 '24 19:09 absidue

Found a bug, if I am viewing comment for a post (IV API) And I paste https://yt.artemislena.eu/post/UgkxhcOTXqzOaLBHfCQ-_-6JxsdydwSeFTei and hit enter the page won't change

PikachuEXE avatar Sep 10 '24 05:09 PikachuEXE