21997f4b5c Fix slow library cover loading: serve sloppak art without unpacking + revalidated caching (#534)
* sloppak: read cover without unpacking + serialize/cap zip unpacks

Album art for a zip-form sloppak was served by resolve_source_dir(), which
unpacks the ENTIRE archive (stems included, ~30 MB) to disk just to read
cover.jpg. On the library grid that meant a full extraction per card on scroll.

- read_cover_bytes(): opens only the cover member from the zip (or reads the
  file for dir-form), with zip-slip guarding. ~4 ms vs a full unpack.
- resolve_source_dir(): per-file lock + bounded global semaphore so concurrent
  callers don't rmtree + re-extract the same dest at once (a race), and a burst
  can't saturate disk/CPU. 8 concurrent calls now dedupe to 1 unpack.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* server: serve sloppak art via read_cover_bytes + cache album-art responses

- get_song_art() sloppak branch now reads the cover directly (no full unpack),
  off-thread via asyncio.to_thread.
- All art responses carry Cache-Control: public, max-age=86400. URLs are already
  cache-busted with ?v=<mtime>, so the browser stops re-fetching every cover on
  scroll-back; day bound self-heals any URL missing ?v.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* v3 library: lazy-load + async-decode card cover images

The grid (24 cards/page) and artist-row thumbnails emitted plain <img> with no
loading hint, so a whole page of covers fetched + decoded at once on each
scroll batch. Add loading="lazy" decoding="async" to defer off-screen fetches
and keep image decode off the main thread.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* address Codex review: zip cover normalization + correct art revalidation

Findings from the preflight Codex passes:

- sloppak.read_cover_bytes (zip form) read the raw manifest cover string via
  zf.read(), so a non-canonical name like './cover.jpg' or 'art/../cover.jpg'
  404'd. Normalize via safe_join → relative member; reject escape and the
  degenerate root-collapse case ('.', 'subdir/..') like _unpack_zip does.

- Album-art caching is correctness-first: Cache-Control: no-cache plus a strong
  validator, with real conditional handling (Starlette FileResponse emits an
  ETag but doesn't evaluate If-None-Match). All three art paths route through
  _art_conditional/_file_art_response → bodyless 304 on a matching validator.
  A long immutable max-age was rejected because the frontend ?v=<mtime> buster
  is only second-resolution and would pin a same-second rewrite.

- The sloppak cover is validated by CONTENT (sha1 of the bytes), not a stat:
  a dir-form sloppak edited in place changes the cover file's mtime but not the
  directory's, so a dir-stat ETag could emit a stale 304. Content hashing is
  correct for both dir- and zip-form. get_song_art gained an optional request
  (internal get_art caller passes none — safe).

Adds tests/test_sloppak_cover_art.py pinning read_cover_bytes (canonical,
non-canonical, degenerate/escape, dir/zip, webp) and the endpoint's 304 contract
incl. the dir-form in-place-edit no-stale-304 regression.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 00:22:43 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00
2026-06-16 18:47:13 +02:00

fee[dB]ack

Plugins

Plugin Description Install
Create from Tab Search Ultimate Guitar for GP tabs and convert to playable songs git clone ...slopsmith-plugin-ug.git ultimate_guitar
Import Tab Drag and drop Guitar Pro files to create songs git clone ...slopsmith-plugin-tabimport.git tab_import
Practice Journal Auto-track practice time, speed, loops. Dashboard with charts git clone ...slopsmith-plugin-practice.git practice_journal
Setlist Builder Create ordered playlists with sequential playback git clone ...slopsmith-plugin-setlist.git setlist
Metronome Audible click and visual beat flash synced to song tempo git clone ...slopsmith-plugin-metronome.git metronome
Tone Player View amp/pedal/cab signal chains with gear artwork git clone ...slopsmith-plugin-tones.git tones
Fretboard View Live fretboard overlay showing active notes in real-time git clone ...slopsmith-plugin-fretboard.git fretboard
Tab View Scrolling guitar tablature notation via alphaTab git clone ...slopsmith-plugin-tabview.git tab_view
MIDI Amp Control Auto-switch amp/modeler presets via MIDI on tone changes git clone ...slopsmith-plugin-midi.git midi_amp
Section Map Color-coded song structure minimap with clickable navigation git clone ...slopsmith-plugin-sectionmap.git section_map
Arrangement Editor DAW-like visual editor for creating and editing song note charts git clone ...slopsmith-plugin-editor.git editor
MIDI Capo MIDI capo control for real-time transposition git clone ...slopsmith-plugin-midi-capo.git midi_capo
Note Detection Real-time pitch detection and scoring against highway notes git clone ...slopsmith-plugin-notedetect.git note_detect
Find More Search for more songs by the same artist git clone ...slopsmith-plugin-find-more.git find_more
Piano Highway Scrolling piano/keyboard view for Keys arrangements with MIDI input git clone ...slopsmith-plugin-piano.git piano
Studio Collaborative band recording and multi-track mixing git clone ...slopsmith-plugin-studio.git studio
Drum Highway Lane-based drum highway with MIDI drum pad input and built-in sounds git clone ...slopsmith-plugin-drums.git drums
Split Screen 2-4 highway panels side-by-side for multi-arrangement practice git clone ...slopsmith-plugin-splitscreen.git splitscreen
Stems Mixer Per-stem mute/volume controls for .sloppak songs git clone ...slopsmith-plugin-stems.git stems
Invert Highway Flip the highway note direction git clone ...slopsmith-plugin-invert-highway.git invert_highway
Jumping Tab Yousician-style 2D horizontal tab with trajectory arcs and hopping ball git clone ...slopsmith-plugin-jumpingtab.git jumpingtab
Step Mode Step-by-step practice mode — highway freezes at each note until played (via Note Detection) or Space git clone ...slopsmith-plugin-stepmode.git step_mode
Lyrics Sync Generate synced LRC lyrics from text + vocals stem via Whisper alignment git clone ...slopsmith-plugin-lyrics-sync.git lyrics_sync
Lyrics Karaoke Per-syllable karaoke pitch ribbon for sloppak songs (Whisper alignment + librosa pYIN) git clone ...slopsmith-plugin-lyrics-karaoke.git lyrics_karaoke
NAM Tone Engine In-browser amp modeling with NAM WASM, cabinet IRs, tone auto-switching git clone ...slopsmith-plugin-nam-tone.git nam_tone
Guitar Theory Lab Explore scales, chords, intervals, tunings, and voicings on a fully interactive fretboard git clone ...slopsmith-plugin-nam-tone.git guitar-theory-lab
Themes Offers several basic recolorings of the interface git clone ...slopsmith-plugin-themes.git themes
Update Manager Installs, updates, and uninstalls other plugins and the slopsmith core itself git clone ...slopsmith-update-manager.git update_manager
Tuner Floating tuner with customizable tunings git clone ...slopsmith-plugin-tuner.git tuner
Simplify Chords Changes complex chords on the note highway to simpler ones. Inspired by Ultimate Guitar's Simplify button. git clone ...slopsmith-plugin-simplify-chords.git simplify-chords
Key Bindings Highway key bindings for keyboard and TV remote git clone ...slopsmith-plugin-key-bindings.git key_bindings
Folder Organizer Organize your sloppak DLC songs into a folder tree view, grouped by subfolder name git clone ...slopsmith-plugin-folder-organizer.git folder-organizer
SlopScale Scale, arpeggio, and sweep-arpeggio practice routines with 3D highway, 2D highway, and tab renderers. Pathway selector, CAGED shape-run arpeggios, and generated audio backing. git clone ...slopsmith-plugin-slopscale.git slopscale
NAM Rig Builder Map tones to chained NAM neural-amp rigs (tone3000 captures + IRs) — full pedal→amp→cab playback, per-stage bypass, and a gear catalog git clone ...slopsmith-plugin-nam-rig-builder.git nam_rig_builder
Audio Preview Quick audio previews from library cards with configurable start time, volume, and duration git clone ...slopsmith-plugin-audio-preview.git audio_preview
Song Mastery Auto-adjusts difficulty based on your rolling note accuracy and saves the slider position per song git clone ...slopsmith-plugin-song-mastery.git song_mastery
Song Preview Quickly hear previews of songs in your library with a clean visual indicator of what's playing. Supports .sloppak and loose folders song formats, with the visual indicator matching up to whatever theme you are using! git clone ...slopsmith-plugin-song-preview.git song_preview
Mobile Note Highway Touch-optimized player with collapsible controls, highway gestures, and device-adaptive layouts for phones and tablets git clone ...slopsmith-plugin-mobile-note-highway.git mobile_note_highway
Shuffle Random playback from your library — artist & tuning filters, auto-advance with countdown popup, note_detect compatible git clone https://github.com/Erikcb91/Slopsmith-Shuffle-Mode.git shuffle

Install any plugin by cloning it into your plugins/ directory and restarting:

cd plugins
git clone https://github.com/got-feedback/feedback-plugin-ug.git ultimate_guitar
docker compose restart
S
Description
No description provided
Readme AGPL-3.0
982 MiB
Languages
JavaScript 56.4%
Python 37.1%
HTML 3.2%
CSS 1.2%
TypeScript 1.1%
Other 1%