Repository navigation
Add a command to remove render rows whose video is gone - #11
Merged
Merged
Conversation
Before DATA_DIR was set in the image, every rebuild deleted render files and kept their rows, so render lists offered videos that 404 on play. `python -m app.render.cleanup` lists finished renders with no video file, and deletes them (and any leftover poster or subtitles) with --apply. Failed, cancelled and running renders are never touched, and a copy saved to GAM stays in GAM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016K8ApooCKMPBVQiLjaWjcp
davior
marked this pull request as ready for review
October 22, 2026 01:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Before #10, renders were written to
/data, outside the volume. Every rebuild deleted the files but kept the database rows, so a project's render list offers videos that 404 when played, and "Save to GAM" refuses them.What
backend/app/render/cleanup.py, run as a module inside the container:status == "done"), and counts one as orphaned when its video file isn't there. Failed and cancelled renders never had a file, and a running one is still writing it, so all three are left alone.--applydeletes the rows plus any leftover poster or subtitle files. A copy already saved to GAM lives in GAM independently and is untouched.Testing
tests/test_render_cleanup.pysets up four renders through the real routes (one with its video, two orphaned, one of them saved to GAM, and one failed). The tests check that the default only lists, that--applyremoves exactly the two orphans and their leftover files, and the warning when no video is found.pytest -q: 665 passed.Generated by Claude Code