Skip to content

fix: scan order, cancel bug, live library size, status colors#4

Merged
chodeus merged 2 commits intomainfrom
claude/fix-beatscheck-scan-order-sp97k
Apr 14, 2026
Merged

fix: scan order, cancel bug, live library size, status colors#4
chodeus merged 2 commits intomainfrom
claude/fix-beatscheck-scan-order-sp97k

Conversation

@chodeus
Copy link
Copy Markdown
Owner

@chodeus chodeus commented Apr 14, 2026

Summary

  • Alphabetical scan order: Sort dirs in-place during os.walk() so scans progress alphabetically by artist folder instead of random filesystem (inode) order
  • Cancel scan fix: beats_check.py runs as __main__ but webui reimports it as a separate beats_check module via from beats_check import cancel_scan, creating two copies with separate scan_cancelled globals — the cancel flag never reached the running scan loop. Fixed by registering __main__ as beats_check in sys.modules at startup
  • Live library size: Library size was calculated at scan start but only written to summary.json at completion. Now pushed to AppState immediately and merged into /api/status so the dashboard shows it as soon as file collection finishes
  • Dashboard status colors: STATUS card on dashboard now shows colored text (green idle, yellow scanning, purple setup, red error) instead of plain white text

Test plan

  • Run a scan and confirm artists are visited in alphabetical order in the logs
  • Click Cancel Scan during a scan and confirm it actually stops (not just logs "cancelling")
  • Verify library size appears on the dashboard at the start of a scan, not only after completion
  • Check the STATUS card on the dashboard shows green text when idle and yellow when scanning

claude added 2 commits April 14, 2026 02:50
os.walk() returns directories in filesystem order (inode order on
ext4/btrfs), which appears random. Sort dirs in-place so the scan
progresses alphabetically through the library.

https://claude.ai/code/session_011hPW1eEc8njbo1xUNXuci4
Cancel scan: beats_check.py runs as __main__ but webui.py reimports it
as a separate 'beats_check' module via `from beats_check import cancel_scan`.
This creates two copies of the module with separate `scan_cancelled` globals,
so the cancel flag never reaches the running scan loop.  Fix by registering
__main__ as 'beats_check' in sys.modules at startup.

Library size: calculated at scan start but only written to summary.json
at scan completion.  Push library_size_human and library_files to AppState
immediately and merge them into the /api/status response so the dashboard
shows the value as soon as file collection finishes.

Status card: the dashboard STATUS card showed plain text with no color
coding.  Add status-based CSS classes (green idle, yellow scanning, etc.)
to the card value element.

https://claude.ai/code/session_011hPW1eEc8njbo1xUNXuci4
@chodeus chodeus changed the title fix: sort directory traversal so scans proceed alphabetically by artist fix: scan order, cancel bug, live library size, status colors Apr 14, 2026
@chodeus chodeus merged commit 7d95110 into main Apr 14, 2026
3 of 4 checks passed
@chodeus chodeus deleted the claude/fix-beatscheck-scan-order-sp97k branch April 14, 2026 03:41
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.

2 participants