wrolpi/wrolpi/test
lrnselfreliance 20be5dfc27
collections: channel and domain listings read trigger-maintained summary columns (#739)
* collections: channel listing reads trigger columns and batch-loads tag/downloads

Listing channel collections summed FileGroup sizes through a video join, which reads a
random page of the file_group table per video, and lazy-loaded every collection's tag
and downloads one query at a time. On a large library with a cold disk cache the
listing took over two minutes, past the browser's 60 s timeout, so the Channels page
showed an error.

channel.video_count and channel.total_size are already maintained by triggers
(wrolpi/schema_ddl.py), so read those. Tag and downloads are selectin-loaded, so the
query count no longer grows with the number of collections.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* collections: domain listing reads trigger-maintained summary columns

Domain Collections summed file_group.size through an archive join on every listing,
one random page read per archive (about 9 s from a cold disk cache on a large
library). New triggers keep collection.item_count and collection.total_size current
for Domain Collections, as the channel triggers already do for Channels, and the
listing reads those columns. A migration installs the triggers and backfills
existing Domain Collections.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-27 11:36:08 -06:00
..
fixtures/configs Add Docs module for searching and organizing PDFs and EPUBs 2026-03-20 14:17:06 -06:00
__init__.py A new start 2021-11-01 16:43:09 -06:00
common.py Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
test_api_fixtures.py test: check declared types, not just field names, and fix the three that were wrong 2026-08-08 18:05:08 -06:00
test_api_utils.py api: run the perpetual loops in one Sanic-managed process (#718) 2026-09-23 07:53:53 -06:00
test_bookmarks.py Bookmarks: a nav menu of user links, stored in bookmarks.yaml (#729) 2026-09-26 13:11:36 -06:00
test_captions.py videos: center YouTube auto-captions at download time 2026-07-16 18:51:36 -06:00
test_cmd.py Single file deno (#478) 2026-06-12 17:07:28 -06:00
test_common.py api: run the perpetual loops in one Sanic-managed process (#718) 2026-09-23 07:53:53 -06:00
test_config_api.py Changing archive special directory default to include domain tag. 2025-12-25 15:42:35 -07:00
test_config_backup_import.py Rebuild Inventory as a config-only system with food catalog and calculators 2026-06-14 17:14:54 -06:00
test_config_partial_import.py Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
test_contexts.py Reformatting code. 2025-12-06 15:11:37 -07:00
test_cross_config_disaster_recovery.py startup: run database config imports off the worker event loop (#723) 2026-09-24 18:22:52 -06:00
test_dates.py Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
test_db.py review: ffprobe out of the write transaction, and three tests that were watching nothing 2026-08-07 20:15:50 -06:00
test_db_bootstrap.py collections: channel and domain listings read trigger-maintained summary columns (#739) 2026-09-27 11:36:08 -06:00
test_downloader.py perpetual: clear in-progress flags after a crash, downloads only in the perpetual process, KillMode=mixed (#726) 2026-09-26 11:22:58 -06:00
test_downloads_config.py downloads: daily limit count was lost on restart (#679) 2026-08-29 16:24:52 -06:00
test_events.py Skipping flaky tests on CircleCI. 2026-06-11 19:46:34 -06:00
test_extensions.py Creating browser extension to facilitate starting downloads. Chrome/Brave and Firefox supported. 2026-05-03 11:48:50 -06:00
test_flags.py Displaying warning when no drive is mounted. 2026-05-14 16:16:18 -06:00
test_fts.py Postgres -> SQLite hard cutover: the database moves into the media directory. 2026-07-12 14:09:37 -06:00
test_jobs.py Jobs queue, video Edit dropdown: transcode/remux, edit title & description (#711) 2026-09-16 19:25:23 -06:00
test_perpetual.py perpetual: clear in-progress flags after a crash, downloads only in the perpetual process, KillMode=mixed (#726) 2026-09-26 11:22:58 -06:00
test_root_api.py api: run the perpetual loops in one Sanic-managed process (#718) 2026-09-23 07:53:53 -06:00
test_rss.py Using stubs to simplify tests. 2026-05-07 20:07:46 -06:00
test_speedtest.py Speed Test calculator: ping, download, and upload against the API (#708) 2026-09-13 18:47:18 -06:00
test_switches.py Fix API stalls: non-blocking switch worker, threaded searches, indexed Videos page (#678) 2026-08-29 16:17:53 -06:00
test_tags.py Speed up tags config import for un-modeled files 2026-07-19 16:21:29 -06:00
test_upgrade.py api: run the perpetual loops in one Sanic-managed process (#718) 2026-09-23 07:53:53 -06:00