Add like count to videos

Same pattern as view_count: model column, yt-dlp extraction, SQL select,
VideoDetail field, startup migration, and display in Watch meta row.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mattias Tall
2026-05-26 11:25:44 +02:00
parent ffd46b5e08
commit 3f225e7647
5 changed files with 6 additions and 1 deletions

View File

@@ -66,6 +66,7 @@ class VideoDetail(BaseModel):
local_file_url: Optional[str] = None
is_recommended: bool = False
view_count: Optional[int] = None
like_count: Optional[int] = None
model_config = {"from_attributes": True}
@@ -422,7 +423,7 @@ def surprise_me(
_VIDEO_SELECT = """
SELECT v.id, v.youtube_video_id, v.title, v.description, v.thumbnail_url,
v.duration_seconds, v.published_at, v.tags, v.category, v.view_count,
v.duration_seconds, v.published_at, v.tags, v.category, v.view_count, v.like_count,
c.id AS channel_id, c.name AS channel_name, c.youtube_channel_id AS channel_youtube_id,
COALESCE(uv.watched, 0) AS watched,
COALESCE(uv.watch_progress_seconds, 0) AS watch_progress_seconds,