Auto-detect HVSC Songlengths.md5 under assets/sids/#78
Merged
Conversation
playlist.songlengths_file previously had to be set explicitly, so quick playback (positional MEDIA args, no [playlist] section to set it in) always fell back to the 180s default duration even with a full HVSC unpacked locally. _load_songlengths now treats an unset (None) path as "probe assets/sids/ for a Songlengths.md5" — checking the two layouts an HVSC unpack actually produces before falling back to a full scan — and only returns None outright for an explicit empty string. Memoized like the existing per-path DB cache, since walking a full HVSC tree isn't free.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 79.61% 79.64% +0.03%
==========================================
Files 77 77
Lines 15676 15701 +25
Branches 2373 2379 +6
==========================================
+ Hits 12480 12505 +25
Misses 2657 2657
Partials 539 539 ☔ View full report in Codecov by Harness. |
Only warns for the specific case worth flagging: a songlengths DB is configured/detected but has no entry for this tune, so a fabricated 180s is used instead of the tune's real length. Having no DB at all stays silent, since that's the expected common state for anyone without HVSC's SongLengths.md5 unpacked.
Wraps two lines that exceeded the line-length limit; pre-commit wasn't installed locally when they were added in the prior commit.
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.
Summary
[playlist].songlengths_filepreviously required an explicit path, so quick playback (positionalMEDIAargs, which has no[playlist]section) always used the 180s fallback duration for waveform scenes even with a full HVSC unpacked locally.None),_load_songlengthsnow auto-detects aSonglengths.md5underassets/sids/— checking the two layouts an HVSC unpack actually produces (assets/sids/C64Music/DOCUMENTS/...andassets/sids/DOCUMENTS/...) before falling back to a full scan for a nonstandard placement. An explicit empty string (songlengths_file = "") opts out.WaveformScenenow logs a warning when it falls back to the 180s default duration because a songlengths DB is configured/detected but has no entry for the current tune — the specific, surprising case (a real DB present, still missing this song). Having no DB at all stays silent, since that's the expected state for anyone without HVSC unpacked.assets/sids/README.md,docs/caveats.md,docs/troubleshooting.md,docs/usage.md, example TOMLs) to describe the new default behavior, and regeneratedc64cast.schema.jsonfor the updated field help text.Test plan
make lintmake typecheck(mypy --strict + pyright)make schema(no further drift)make test(1963 tests, all pass)Songlengths.md5(61,157 entries) whensonglengths_fileis unset