wrolpi/modules/videos
lrnselfreliance 673c23188c
Request sessions keep objects after commit; guard dict() serializers (#811)
A RequestSession no longer expires loaded objects at commit, so a handler serializes what it
committed without a reload query.  An AsyncSession cannot run that reload at all, so this is
groundwork for moving request handling to async.  Background sessions (get_db_session) keep
SQLAlchemy's default: they change data outside the ORM (raw SQL, triggers) and rely on the reload.

Collection, CollectionItem and Channel dict() now run inside the serializer guard.  Fixes it found:
- Channel.dict() no longer loads the deferred yt-dlp catalog (info_json), which the channel
  handler loaded only to discard.
- get_channel eager-loads what Channel.dict() reads (populate_existing replaces a refresh query).
- create_channel / get_or_create_download link through relationships, so a loaded
  Collection.downloads stays current.
- Setting a Repo to Never removes the deleted Download from the loaded collection; the response
  reported the old frequency.
- The downloader no longer calls channel.dict() to preload a Channel; its callers read it inside
  the session.

Tests run each request with expiry off, as production does, and turn it back on for the background
work that shares the test Session.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 19:15:33 -06:00
..
channel Request sessions keep objects after commit; guard dict() serializers (#811) 2026-10-10 19:15:33 -06:00
test Rename skip_circleci to skip_ci (#797) 2026-10-08 17:28:13 -06:00
video db: serializers read only loaded data (#777) 2026-10-04 18:28:08 -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 db: request-path library functions use the request's connection (#774) 2026-10-04 11:05:20 -06: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 Request sessions keep objects after commit; guard dict() serializers (#811) 2026-10-10 19:15:33 -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 db: request-path library functions use the request's connection (#774) 2026-10-04 11:05:20 -06:00
models.py Request sessions keep objects after commit; guard dict() serializers (#811) 2026-10-10 19:15:33 -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 Other search tab: search Channels by name, add Domains and Playlists, fix the estimate (#785) 2026-10-07 18:22:12 -06:00
transcode.py videos: transcode can remove the audio stream (silent video) (#737) 2026-09-26 17:49:14 -06:00