Repository navigation
Import music tracks from a library's web page - #48
Merged
Merged
Conversation
Paste a page (incompetech, Mixkit, or any page listing tracks), review what it holds, tick what you want, and import each as its own job with the page's details on it. - Read best source first: incompetech's pieces.json (the file its page loads), schema.org MusicRecording JSON-LD, Mixkit's card links for moods, instruments and tags, then the AI provider (held to the audio URLs actually on the page), then bare audio links. - ingest/web.py: SSRF-checked on every redirect, capped while streaming, uncompressed audio only, non-audio responses refused. - Page metadata lands stamped "embedded": credits (incompetech's exact CC BY wording), genres, moods, instruments, BPM and tags. Tempo, key and energy the page left out are then measured from the sound. - Tracks already in the library are marked and not downloaded twice; at most 50 per import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCL4jm6ogZBBhnjEfBBaXU
The URL alone missed the same file under another address and files uploaded by hand. Now: - Checksum: after downloading, the file's SHA-256 is matched against the library. A copy already here is kept, the download discarded, and the page's details only fill its blanks (corrections stay); its source URL is recorded so the URL check catches it next time. - A track ticked twice in one import is one job. - The review list flags "Maybe in library" when the title (and artist, when both are known) matches an audio file already here: a different file of the same piece. Still tickable; "Tick shown" skips it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DCL4jm6ogZBBhnjEfBBaXU
davior
marked this pull request as ready for review
October 26, 2026 11:33
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.
You can now paste a page from a music library into Add → "Or paste a page of music tracks" and press Find tracks. GAM lists the tracks on the page with their details. You filter the list, tick the tracks you want (up to 50 at a time) and import them. Each track becomes its own background job: it is downloaded, catalogued like an upload and given the page's details. The tempo, key and energy analysis from davior/gam#47 then fills in whatever the page left out.
How a page is read (
app/ingest/page_tracks.py)Sources are tried in order, most reliable first, and the review list says which one was used:
pieces.json, so GAM reads that file directly. Title, genre and album (names taken from the lookup tables in the page's own script), feel (as moods), instruments, BPM, length, description, date, and the licence's exact CC BY attribution text as the credit line.MusicRecordingJSON-LDDuplicates
A track ticked twice in one import becomes a single job.
Downloading (
app/ingest/web.py)What lands on the asset
The page's details are stamped
embedded:Checked against your saved pages
pieces.json. I couldn't reach the file itself, so the adapter reads exactly the fields the page's own script uses, and the test fixture follows that shape.Design notes are in
docs/page-import.md.Testing
pytest -q: 1370 passed.tests/test_page_import.pycovers:npm run format:check,npm run lint,npm test(425 passed) andnpm run buildall clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01DCL4jm6ogZBBhnjEfBBaXU