Changing video view_count to bigint for popular videos.
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Controller Tests / controller-tests (push) Waiting to run
Jest Tests / jest-tests (push) Waiting to run

This commit is contained in:
Roland 2026-02-08 12:33:27 -07:00
parent 387ef6dfe8
commit a5dee64af2
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
3 changed files with 31 additions and 2 deletions

View file

@ -351,7 +351,7 @@ async def update_view_counts_and_censored(channel_id: int):
with get_db_curs(commit=True) as curs:
# Update the view_count for each video.
stmt = '''
WITH source AS (select * from json_to_recordset(%s::json) as (id text, view_count int))
WITH source AS (select * from json_to_recordset(%s::json) as (id text, view_count bigint))
UPDATE video
SET view_count = s.view_count
FROM source as s

View file

@ -34,7 +34,7 @@ class Video(ModelHelper, Base):
id = Column(Integer, primary_key=True)
source_id = Column(String) # The id from yt-dlp
view_count = Column(Integer) # The view count from the ChannelDownloader (or from initial download)
view_count = Column(BigInteger) # The view count from the ChannelDownloader (or from initial download)
ffprobe_json = deferred(Column(JSONB)) # Data that is fetched once from ffprobe (ffmpeg)
have_comments = Column(Boolean, default=False) # see `get_missing_videos_comments`
comments_failed = Column(Boolean, default=False) # see `get_missing_videos_comments`