feat: display play count on video detail page
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 3m47s
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 3m47s
- Add play count display below video title with play icon
- Query actual plays count from sexy_video_plays table for accuracy
- Apply same pattern as likes_count for consistency
- Show singular/plural ("play" vs "plays") based on count
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,15 @@ export default {
|
||||
.first();
|
||||
|
||||
video.likes_count = parseInt(likesCount?.count || 0);
|
||||
|
||||
// Count actual plays from database
|
||||
const playsCount = await database
|
||||
.count("* as count")
|
||||
.from("sexy_video_plays")
|
||||
.where("video_id", video.id)
|
||||
.first();
|
||||
|
||||
video.plays_count = parseInt(playsCount?.count || 0);
|
||||
}
|
||||
|
||||
res.json(videos);
|
||||
@@ -257,6 +266,15 @@ export default {
|
||||
|
||||
video.likes_count = parseInt(likesCount?.count || 0);
|
||||
|
||||
// Count actual plays from database
|
||||
const playsCount = await database
|
||||
.count("* as count")
|
||||
.from("sexy_video_plays")
|
||||
.where("video_id", video.id)
|
||||
.first();
|
||||
|
||||
video.plays_count = parseInt(playsCount?.count || 0);
|
||||
|
||||
res.json(video);
|
||||
} catch (error: any) {
|
||||
console.error("Video by slug error:", error);
|
||||
|
||||
Reference in New Issue
Block a user