feedBack/lib/routers
=Scr4tch= 196008a98e fix(sloppak/ws_highway): drums stay in picker and show correct hit count
Problem:
The editor strips drum arrangements from the sloppak manifest, converting
them to a drum_tab sidecar.  This left two visible bugs:

1. "Drums (0)" — drum-only packs showed zero notes in the arrangement
   picker even though the drum highway displayed thousands of hits.  The
   sloppak loader synthesized a placeholder Arrangement(name="Drums")
   with no notes whenever the arrangements list was empty, and the
   WebSocket highway always reported that placeholder's note count (0).

2. Drums disappear alongside other arrangements — when a drum+bass or
   drum+guitar pack was loaded, the placeholder was never created because
   the arrangements list was not empty (the other instrument was present).
   The drum arrangement had been removed by the editor during drum_tab
   conversion, so drums vanished entirely from the arrangement picker.

Fix (sloppak.py):
Replaced the "arrangements list is empty" trigger with "no drum
arrangement exists".  The loader now checks whether any arrangement name
contains 'drum' or 'percussion' (case-insensitive substring match using
_DRUM_KEYWORDS) and synthesizes the placeholder when a drum_tab is
present but no matching arrangement is found.  This ensures drums appear
in the picker even alongside bass, guitar, or other pitched instruments.

Fix (ws_highway.py):
When building the arrangement list for the song_info WebSocket message,
the highway now reads the drum_tab hit count from the loaded sloppak and
substitutes it for any empty arrangement whose name matches the drum
keywords.  The placeholder has no notes of its own (it exists only to
carry the drum_tab through to the drum highway), so the real hit count
from drum_tab is surfaced instead — e.g. "Drums (1922)" instead of
"Drums (0)".

Guard against false positives:
The hit-count override is scoped to drum/percussion arrangements only.
Without this guard, an empty "Vocals" or "Keys" track in the same
pack would incorrectly inherit the drum hit count.  The same keyword set
_DRUM_KEYWORDS = ('drum', 'percussion') is used in both sloppak.py and
ws_highway.py to keep the detection consistent.

Signed-off-by: =Scr4tch= <305609711+0-Scr4tch-0@users.noreply.github.com>
2026-07-20 12:05:37 -04:00
..
__init__.py fix(build): move appstate.py + routers/ under lib/ so the desktop app ships them (#836) 2026-07-10 17:16:34 +02:00
art.py refactor(server): extract the album-art routes into routers/art.py (R3) (#862) 2026-07-11 11:56:53 +02:00
artist_aliases.py refactor(server): extract the artist-alias routes into routers/artist_aliases.py (R3) (#838) 2026-07-10 18:55:03 +02:00
artist.py refactor(server): extract the artist routes into routers/artist.py (R3) (#870) 2026-07-11 15:49:37 +02:00
audio_effects.py fix(build): move appstate.py + routers/ under lib/ so the desktop app ships them (#836) 2026-07-10 17:16:34 +02:00
chart.py refactor(server): extract the chart routes into routers/chart.py (R3) (#846) 2026-07-10 22:15:25 +02:00
diagnostics.py refactor(server): extract the diagnostics routes into routers/diagnostics.py (R3) (#857) 2026-07-11 01:27:52 +02:00
enrichment.py refactor(server): extract the enrichment route handlers into routers/enrichment.py (R3) (#868) 2026-07-11 15:19:34 +02:00
library_extras.py refactor(server): batch the small meta_db user-state endpoints into routers/library_extras.py (R3) (#850) 2026-07-10 23:37:24 +02:00
library.py fix(library): tuning filter answers for your instrument, not always guitar (#1003) 2026-07-19 00:04:30 -05:00
loops.py fix(loops): take the DB lock for the count+insert and the list read (#840) 2026-07-10 19:16:01 +02:00
media.py refactor(server): extract the media/file-serving routes into routers/media.py (R3) (#869) 2026-07-11 15:36:22 +02:00
playlists.py feat(playlists): manual drag order + Sort A-Z for the playlist list (#1004) 2026-07-19 00:04:23 -05:00
profile.py refactor(server): extract the profile routes into routers/profile.py (R3) (#854) 2026-07-11 00:38:03 +02:00
progression.py refactor(server): extract the progression routes into routers/progression.py (R3) (#853) 2026-07-11 00:25:53 +02:00
settings.py refactor(server): extract the settings routes into routers/settings.py (R3) (#863) 2026-07-11 12:35:05 +02:00
shop.py refactor(server): extract the shop routes + inject get_progression_content into the seam (R3) (#851) 2026-07-10 23:42:02 +02:00
song.py Pass per-stem name/description through to the stems payloads (#1013) 2026-07-19 11:45:16 -04:00
stats.py feat(career): hours-per-genre odometer — honest wall-clock play time (#942) 2026-07-13 15:12:23 +02:00
tunings.py refactor(server): extract /api/tunings into routers/tunings.py + lib/appconfig.py (R3) (#858) 2026-07-11 01:43:19 +02:00
version.py refactor(server): extract the version route into routers/version.py (R3) (#856) 2026-07-11 00:56:36 +02:00
wanted.py refactor(server): extract the wishlist routes into routers/wanted.py (R3) (#847) 2026-07-10 22:20:10 +02:00
ws_highway.py fix(sloppak/ws_highway): drums stay in picker and show correct hit count 2026-07-20 12:05:37 -04:00