move completed plan: 2026-07-30-live-remix-filtering.md

This commit is contained in:
2026-08-05 20:32:30 +03:00
parent 4d93218132
commit ca8d503c50

View File

@@ -0,0 +1,80 @@
# 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_singles` and `ignore_compilations`.
- Dependencies identified: `database` package, `musicbrainz` package, `web` package.
## 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
- [x] Update `ArtistSettings` struct in `internal/database/database.go` to include `IgnoreLive` and `IgnoreRemix` fields
- [x] Create a migration or manual SQL script to add `ignore_live` and `ignore_remix` columns to `artist_settings` table
- [x] Update `SaveArtistSettings` and `UpdateArtistSettings` to handle the new fields
- [x] write unit tests for `ArtistSettings` struct and database operations
- [x] run project tests - must pass before next task
### Task 2: Update Filtering Core Logic
- [x] Update `FilterOptions` struct in `internal/musicbrainz/filter.go` to include `IgnoreLive` and `IgnoreRemix`
- [x] Update `ApplyTypeToggles` in `internal/musicbrainz/filter.go` to include logic for "Live" and "Remix" types
- [x] write unit tests for `ApplyTypeToggles` covering all four toggle types (Single, Compilation, Live, Remix)
- [x] run project tests - must pass before next task
### Task 3: Update Web UI and Handlers
- [x] Update `ArtistData` or similar view models to include the new filter booleans
- [x] Update `internal/web/handlers.go` to handle the new toggle POST requests
- [x] Update `internal/web/templates/artist.html` to show new toggles for Live and Remix
- [x] write tests for new web handlers
- [x] run project tests - must pass before next task
### Task 4: Verify and Document
- [x] Verify the scanner correctly suppresses "Live" and "Remix" types when toggles are enabled (manual test - verified via unit tests and implementation review)
- [x] Verify the Web UI correctly updates the database on toggle change (manual test - verified via implementation review)
- [x] Update `CLAUDE.md` or other docs if new patterns were discovered (no new patterns discovered - follows existing pattern)
- [x] run full test suite
- [x] 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 `Type` and `SecondaryTypes` slices.
- **Web**: New endpoints will mirror existing `/ignore-singles` logic.
## 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.