UI ux improvements#10
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Register every submitted Download in server-owned Active state as Queued and broadcast a download_queued event the instant the server accepts it, so a card appears even when all workers are busy. The worker transitions the card in place to Downloading, then finalizes it into server-owned History with its terminal state (Completed / Failed / Skipped), surviving a page refresh (ADR-0002). - Make the rip subprocess boundary injectable (run_rip seam) so tests never launch a real rip process; streamrip stays a CLI subprocess (ADR-0001). - Extract build_rip_command (pure) with --no-db support for later Redownload. - Skip detection keys on the "Marked as downloaded in the database" log line via classify_download, replacing the prior heuristic. - /api/status returns Active as a list + full History for frontend rehydration. - Frontend rehydrates from /api/status on load, handles the queued event, renders Queued cards (no spinner) that transition in place to Downloading. - Bootstrap pytest + Flask test client suite covering enqueue->queued via API and stubbed runs reaching completed/failed/skipped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
History entries built in finalize_download now carry the Download's original URL and quality (read from the Active record) alongside its metadata and final status, so the server-owned History the frontend rehydrates from /api/status is complete enough for the Redownload slice to re-run an entry verbatim. The download_queued/started/completed SSE deltas carry url+quality too, and the frontend threads them through the Active map and History so live deltas and rehydration stay in sync. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Redownload action to History cards that re-enqueues the item as a
brand-new Download whose `rip` invocation includes --no-db, forcing
streamrip to ignore its own database (see the Redownload glossary entry).
The action is emphasized on `skipped` ("already downloaded") cards and
available quietly on every other History entry.
The new /api/redownload endpoint re-enqueues by History id, reusing the
original URL, quality, and metadata; enqueue_download now threads no_db
through to the worker, which passes it to the existing pure
build_rip_command. The new Download follows the normal lifecycle and
appears as queued immediately with a fresh id distinct from the original.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… submit (#3) Replace every alert() call site with a non-blocking, stacking, auto-dismissing toast (success/error/info). Download submit and download-from-search now confirm acceptance with a 'Queued' toast and no longer yank the user to the Active tab — the toast confirms, the user chooses when to look. Config save, search/connection errors, and load failures also surface as toasts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the Files tab's flat file dump with a browsable Library view over the albums on disk. /api/library walks the download dir and returns album folders grouped by artist without reading any tags, so it stays instant on large libraries. /api/library/album lazily reads one album's present tracks, with titles and track numbers from embedded tags (ADR-0003) via an injectable read_audio_tags seam (mirrors run_rip), so tests need neither mutagen nor real audio files. Non-audio files (cover art, logs) are never listed as tracks, and an untagged present track falls back to its filename rather than being hidden. The view is read-only: a folder on disk carries no source URL, so there is no Redownload here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rary (#7) Derive Album completeness (ADR-0003) entirely from the embedded tags of present tracks: a pure assess_completeness() takes plain disc/track/tracktotal /disctotal data and returns Complete / Incomplete (missing numbers per disc) / Unknown, detecting interior and trailing gaps per disc with no network and no stored metadata. The per-album endpoint now serves the full expected sequence (present tracks plus greyed, number-only missing gap rows) and the badge data, cached per album keyed on folder mtime so re-expanding an unchanged album reads no tags. The Library UI shows a COMPLETE / INCOMPLETE (n missing) / UNKNOWN badge per album and renders "Track N - missing" gap rows in sequence position. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…antics Root cause (two false assumptions, both contradicted by real rips): 1. list_library_albums assumed an Artist/Album directory nesting; streamrip's default folder_format is FLAT, with multi-disc audio in 'Disc N' subfolders. Disc folders were listed as separate albums grouped under the album name as if it were an artist, and every flat album fell under 'Unknown Artist'. 2. assess_completeness assumed tracktotal was per-disc; streamrip tags it ALBUM-wide while tracknumber restarts per disc, so each disc of a multi-disc album reported phantom missing tracks. Now: disc folders fold into their parent album; root-level albums render ungrouped (artist=null); tracks are collected across disc subfolders; the assessment cache mtime includes disc subfolders; completeness follows the real tag semantics (interior gaps locatable per disc, trailing multi-disc gaps counted exactly but reported as unlocated, wholly missing discs detected via disctotal). ADR-0003 and CONTEXT.md amended with the verified semantics. Also in this commit (inseparable from the fix hunks): - app.py reformatted wholesale by the on-save formatter (black/isort style); behavior-neutral, full suite green (68 passed) - style.css: history-card redownload button wraps on mobile viewports Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
No description provided.