wrolpi/modules/videos
Roland 07980af10c
collections: listing answers channel and download queries from covering indexes
The listing still read every channel row (for the summary columns) and every download
row of the listed Collections (for the minimum frequency). Both tables store yt-dlp
info_json, so rows are tens of KB and each sits on its own scattered page; selecting
fewer columns did not help because the seek per row is the cost. From a cold disk
cache that was 5 s per table, 10+ s total, on a large library.

Two covering indexes, channel (collection_id, video_count, total_size) and
download (collection_id, frequency), answer both queries without touching a row. The
listing no longer loads Download objects at all; it computes min_download_frequency
with one grouped query and drops the unused `downloads` array from listing rows (the
detail endpoints keep it; the list views only read min_download_frequency).

Adds a models-vs-migrations test (alembic check) so an index or column added to a
model without a migration, or vice versa, fails the suite.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-27 12:36:14 -06:00
..
channel api: run the perpetual loops in one Sanic-managed process (#718) 2026-09-23 07:53:53 -06:00
test videos: transcode can remove the audio stream (silent video) (#737) 2026-09-26 17:49:14 -06:00
video videos: transcode can remove the audio stream (silent video) (#737) 2026-09-26 17:49:14 -06:00
__init__.py files: shared modeler batch loop for video, doc, zim, archive (#722) 2026-09-24 16:47:46 -06:00
api.py Unifying video download settings so that global/channel/rss/video 2026-03-05 17:40:17 -07:00
common.py Jobs queue, video Edit dropdown: transcode/remux, edit title & description (#711) 2026-09-16 19:25:23 -06:00
conftest.py Search: fast ABC mode by default, opt-in deep search 2026-07-03 10:32:16 -06:00
cookies.py Using shared context to sync cookies between processes. 2026-02-22 14:32:27 -07:00
downloader.py Jobs queue, video Edit dropdown: transcode/remux, edit title & description (#711) 2026-09-16 19:25:23 -06:00
errors.py Adding toggle to Channel page to stop downloading comments for certain channels. 2025-03-01 18:23:29 -07:00
lib.py Jobs queue, video Edit dropdown: transcode/remux, edit title & description (#711) 2026-09-16 19:25:23 -06:00
models.py collections: listing answers channel and download queries from covering indexes 2026-09-27 12:36:14 -06:00
normalize_video_url.py A video that is uploaded is attached to its Channel. Saving Channels config with both download url and frequency in case downloads config is corrupted. 2024-10-16 18:56:11 -06:00
schema.py videos: transcode can remove the audio stream (silent video) (#737) 2026-09-26 17:49:14 -06:00
transcode.py videos: transcode can remove the audio stream (silent video) (#737) 2026-09-26 17:49:14 -06:00