Converting JSON columns to JSONB for performance.
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled

This commit is contained in:
Roland 2026-01-06 06:23:32 -07:00
parent ce9f12da42
commit 1d9b794fca
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
7 changed files with 68 additions and 15 deletions

View file

@ -35,7 +35,7 @@ def get_incomplete_videos(limit: int, offset: int, channel_id: int) -> List[dict
-- {'streams': [{'codec_type': 'video'}, {'codec_type': 'audio'}]} -> {video,audio}
select v.id, array_agg(s ->> 'codec_type')::TEXT[] AS codec_types
from video v
cross join lateral json_array_elements(ffprobe_json -> 'streams') s
cross join lateral jsonb_array_elements(ffprobe_json -> 'streams') s
where channel_id = %(channel_id)s
group by v.id)
SELECT all_videos.id AS video_id, fg.primary_path, all_videos.codec_types