Repository navigation
Replace re-encoded copies with YouTube-style video versions - #56
Merged
Merged
Conversation
Each re-encode became a separate asset with a copy of the original's metadata. What is wanted instead is YouTube-style versions: one asset, with standard-resolution files hanging off it. The next commit builds that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD6HjkZNo9XQSHdawSb
A video asset gets a Versions tab: the original, and a row per standard size below it (4K, 1440p, 1080p, 720p, 480p, 360p), each made by hand with Create. A version is a file of the one asset (new `assetversion` table), not an asset of its own, so there is nothing to copy or keep in step: name, tags, attribution, transcript and clips stay on the asset. - One ffmpeg run in the job queue (`make_version`), the encode from #55: short side as the target (portrait 4K -> 1080x1920), setsar=1 for square pixels, and ffmpeg's -progress driving percent, liveness and Cancel. - "Make original" swaps a version's file in as the asset's own and deletes the big original: how space comes back. Same row and id, so tags, transcript and clips carry on; the timeline does not change. - Deleting the asset deletes its versions and their files. A version being made blocks the delete and make-original. - File counts and sizes: versions are their own group in the storage panel and in the library total, "Largest files" ranks by original plus versions and says how much is versions, and the stray sweep counts version files as referenced rather than deleting them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1geD6HjkZNo9XQSHdawSb
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.
What
Two commits:
assetversiontable, not an asset of its own. Name, tags, attribution, transcript and clips stay on the asset, so nothing is copied.Decisions
setsar=1keeps pixels square;-progressoutput drives the percent, keeps the job from being swept as stale, and is where Cancel takes effect.GET /api/assets/{id}/versionsis what it would read to use the 1080p file in a 1080p project.Migration
assetversionis a new table; nothing existing changes. Runalembic upgrade head(the Docker entrypoint does this).Tests
backend/tests/test_versions.py(22 tests):VersionsTab.test.tsxand newStoragePanelcases.pytest -q1468 passed; frontendformat:check,lint,npm test(454) andbuildall clean.Generated by Claude Code