Fix comments (Python API), add dislike bar

Comments: switch from CLI --write-comments to yt-dlp Python API with
getcomments=True — more reliable, proper extractor_args dict format

Dislikes: add dislike_count column, fetch from returnyoutubedislike.com
after each video metadata upsert (5s timeout, non-fatal)

UI: replace emoji like count with a like/dislike ratio bar — blue fill
showing like proportion, labels on each end; views stay in meta row

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mattias Tall
2026-05-26 11:33:00 +02:00
parent c9e64d2814
commit 74e2b4cd73
5 changed files with 83 additions and 22 deletions

View File

@@ -85,6 +85,7 @@ def init_db():
# Column migrations — safe to run on every startup
_add_column_if_missing(raw_conn, "videos", "view_count", "INTEGER")
_add_column_if_missing(raw_conn, "videos", "like_count", "INTEGER")
_add_column_if_missing(raw_conn, "videos", "dislike_count", "INTEGER")
raw_conn.commit()
# executescript handles multi-statement SQL including trigger BEGIN...END blocks
raw_conn.executescript(FTS_SETUP_SQL)