4.1 KiB
4.1 KiB
Implement Live/Remix Filtering
Overview
- Implement support for "Live" and "Remix" secondary type filtering for artist discographies.
- Problem it solves: Users currently cannot filter out Live or Remix albums/singles, which can clutter the dashboard.
- Key benefits: Improved user experience and cleaner discography views.
Context (from discovery)
- Files/components involved:
internal/database/database.go(ArtistSettings struct)internal/musicbrainz/filter.go(FilterOptions, ApplyTypeToggles)internal/web/handlers.go(Artist detail view)internal/web/templates/artist.html
- Related patterns found: Follows the existing pattern for
ignore_singlesandignore_compilations. - Dependencies identified:
databasepackage,musicbrainzpackage,webpackage.
Development Approach
- Testing approach: TDD (tests first)
- Complete each task fully before moving to the next
- Make small, focused changes
- CRITICAL: every task MUST include new/updated tests for code changes in that task
- CRITICAL: all tests must pass before starting next task - no exceptions
- CRITICAL: update this plan file when scope changes during implementation
- Run tests after each change
- Maintain backward compatibility
Testing Strategy
- Unit tests: required for every task (see Development Approach above)
- E2E tests: None required for this scope.
Progress Tracking
- Mark completed items with
[x]immediately when done - Add newly discovered tasks with ➕ prefix
- Document issues/blockers with ⚠️ prefix
- Update plan if implementation deviates from original scope
- Keep plan in sync with actual work done
What Goes Where
- Implementation Steps (
[ ]checkboxes): code changes, tests, documentation updates - Post-Completion (no checkboxes): manual testing of the scanner and web UI
Implementation Steps
Task 1: Update Database Schema and Model
- Update
ArtistSettingsstruct ininternal/database/database.goto includeIgnoreLiveandIgnoreRemixfields - Create a migration or manual SQL script to add
ignore_liveandignore_remixcolumns toartist_settingstable - Update
SaveArtistSettingsandUpdateArtistSettingsto handle the new fields - write unit tests for
ArtistSettingsstruct and database operations - run project tests - must pass before next task
Task 2: Update Filtering Core Logic
- Update
FilterOptionsstruct ininternal/musicbrainz/filter.goto includeIgnoreLiveandIgnoreRemix - Update
ApplyTypeTogglesininternal/musicbrainz/filter.goto include logic for "Live" and "Remix" types - write unit tests for
ApplyTypeTogglescovering all four toggle types (Single, Compilation, Live, Remix) - run project tests - must pass before next task
Task 3: Update Web UI and Handlers
- Update
ArtistDataor similar view models to include the new filter booleans - Update
internal/web/handlers.goto handle the new toggle POST requests - Update
internal/web/templates/artist.htmlto show new toggles for Live and Remix - write tests for new web handlers
- run project tests - must pass before next task
Task 4: Verify and Document
- Verify the scanner correctly suppresses "Live" and "Remix" types when toggles are enabled
- Verify the Web UI correctly updates the database on toggle change
- Update
CLAUDE.mdor other docs if new patterns were discovered - run full test suite
- verify no breaking changes were introduced
Technical Details
- Database:
ignore_live(boolean, default false),ignore_remix(boolean, default false) - Filtering: "Live" and "Remix" will be checked in both primary
TypeandSecondaryTypesslices. - Web: New endpoints will mirror existing
/ignore-singleslogic.
Post-Completion
Manual verification:
- Verify that toggling "Live" in the Web UI actually removes "Live" results from the scanner output.
- Verify that toggling "Remix" in the Web UI actually removes "Remix" results from the scanner output.
- Verify that these filters do not affect "Single" or "Compilation" filtering.