Skip to content

Auto-detect HVSC Songlengths.md5 under assets/sids/#78

Merged
kfox merged 3 commits into
mainfrom
feat/songlengths-autodetect
Jul 8, 2026
Merged

Auto-detect HVSC Songlengths.md5 under assets/sids/#78
kfox merged 3 commits into
mainfrom
feat/songlengths-autodetect

Conversation

@kfox

@kfox kfox commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • [playlist].songlengths_file previously required an explicit path, so quick playback (positional MEDIA args, which has no [playlist] section) always used the 180s fallback duration for waveform scenes even with a full HVSC unpacked locally.
  • Left unset (the default None), _load_songlengths now auto-detects a Songlengths.md5 under assets/sids/ — checking the two layouts an HVSC unpack actually produces (assets/sids/C64Music/DOCUMENTS/... and assets/sids/DOCUMENTS/...) before falling back to a full scan for a nonstandard placement. An explicit empty string (songlengths_file = "") opts out.
  • WaveformScene now 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.
  • Updated docs (assets/sids/README.md, docs/caveats.md, docs/troubleshooting.md, docs/usage.md, example TOMLs) to describe the new default behavior, and regenerated c64cast.schema.json for the updated field help text.

Test plan

  • make lint
  • make typecheck (mypy --strict + pyright)
  • make schema (no further drift)
  • make test (1963 tests, all pass)
  • Manually verified auto-detection loads the real local HVSC Songlengths.md5 (61,157 entries) when songlengths_file is unset

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

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.64%. Comparing base (2658a63) to head (91e6aa2).
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

kfox added 2 commits July 7, 2026 22:14
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.
@kfox kfox merged commit e50876d into main Jul 8, 2026
8 checks passed
@kfox kfox deleted the feat/songlengths-autodetect branch July 8, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant