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

WIP: Add Comment Count to Video Preview Components #6635

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

RF9A5V
Copy link

@RF9A5V RF9A5V commented Sep 27, 2024

Description

For backend changes, I added a migration that adds a commentCount column to the video table.

The migration:

  1. Creates a column for commentCount on the "video" table that is at first nullable
  2. Batches all videos in groups of 1000 to populate the actual values of comment counts for existing data
  3. Sets default value of commentCount to 0 for future videos after population
  4. Enforces presence of commentCount after population

From there, I've also updated the video comment model to add triggers for events that impact visibility of comments on a video, with those being:

  • Creating a comment
  • Deleting a comment
  • When a comment becomes held for review

At this time, I think I've missed the case when we ban/unban or delete a user, will try to find remaining cases if the approach seems sound so far.

From there, also added the commentCount field to the video model and made the field visible by adding it to relevant formatter definitions.

Front end changes are less significant, just some setup to allow the commentCount to come through from the API, then the UI changes to display the value.

Also added commentCount to the displayOptions, but tbh I still need to dig further into that. Still not sure exactly how this bit works yet, but it seems reasonable to have the commentCount as an optional display, would just need to trace the behavior and implement.

Related issues

Resolves #492

Implements UI based on screenshot provided from #3166

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this PR does not update server code
  • 🙋 no, because I need help

Some manual testing at this time does show the comment count coming through, but still need to implement unit tests.

Screenshots

Screenshot from 2024-09-27 12-33-54

@RF9A5V RF9A5V marked this pull request as draft September 28, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show number of comments in "my videos"
1 participant