Repository navigation
Add media recovery page - #1973
Merged
Merged
Conversation
JeffreyCA
force-pushed
the
recovery-mode
branch
from
August 5, 2026 04:31
c94dc0f to
93a285f
Compare
Add a hidden /recovery page for rebuilding database entries from files remaining in the media directory, for recovering from database loss when the media files survived. The scan endpoint parses upload and mix directories (whose names are the original UUID primary keys) and recovers metadata from audio tags and the metadata encoded in mix filenames. The page presents the results for review in two tabs: uploads are imported first with editable artist and title, then mixes are assigned to the recovered tracks, with placeholder tracks available for mixes whose original upload is gone. Files can be previewed by ear, including individual stems of dynamic mixes. Recovery is best-effort and local storage only. Each item is imported in its own transaction and reported individually, and re-running skips anything already present. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JeffreyCA
force-pushed
the
recovery-mode
branch
from
August 9, 2026 21:11
16e7ca1 to
0243ac0
Compare
Mix artist and title now always describe the mix file instead of mirroring the selected source track, which made a wrong assignment impossible to spot, and the source track dropdown is now sorted. Scanning does fewer filesystem calls, and the gunicorn and nginx timeouts are raised, since a large media directory on a slow bind mount exceeded the 30s default.
The recovery scan filtered upload directories with VALID_FILE_EXT, which only covers what users are allowed to upload directly. YouTube downloads live in the same directory and are named after the format that was fetched, so anything landing as .mp4 was silently skipped: the upload never appeared on the recovery page, and the mixes made from it could not be assigned to any track. Recovery now reads every extension yt-dlp can leave behind. Those extensions were also unreliable. The name came from a separate extraction that could resolve a different format than the one actually downloaded, leaving files named for a format they did not contain. The output template now carries %(ext)s and the stored path is taken from the file yt-dlp wrote, which removes the need for get_file_ext. Bump yt-dlp and pin yt-dlp-ejs so JS challenge solving works. Without it the audio-only formats are dropped and 'bestaudio/best' falls back to a progressive video stream.
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.
Add a hidden /recovery page for rebuilding database entries from files remaining in the media directory, for recovering from database loss when the media files survived.
The scan endpoint parses upload and mix directories (whose names are the original UUID primary keys) and recovers metadata from audio tags and the metadata encoded in mix filenames. The page presents the results for review in two tabs: uploads are imported first with editable artist and title, then mixes are assigned to the recovered tracks, with placeholder tracks available for mixes whose original upload is gone. Files can be previewed by ear, including individual stems of dynamic mixes.
Recovery is best-effort and local storage only. Each item is imported in its own transaction and reported individually, and re-running skips anything already present.