Add view count to videos
- Video model: view_count column (Integer, nullable) - ytdlp._normalize_video: extract view_count from yt-dlp info - _VIDEO_SELECT: include v.view_count in all queries - VideoDetail schema: view_count field - Watch page: formatViews() helper, show "X.XM views" in meta row alongside date and category Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,7 @@ def _normalize_video(info: dict) -> dict:
|
||||
"tags": json.dumps(info.get("tags") or []),
|
||||
"category": info.get("category") or (info.get("categories") or [None])[0],
|
||||
"chapters": json.dumps(chapters) if chapters else None,
|
||||
"view_count": info.get("view_count"),
|
||||
"channel": {
|
||||
"youtube_channel_id": info.get("channel_id"),
|
||||
"name": info.get("channel") or info.get("uploader", ""),
|
||||
|
||||
Reference in New Issue
Block a user