- Add 002-SUMMARY.md with task details and verification results - Update STATE.md quick tasks table
2.5 KiB
2.5 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| quick | 002 | playlist-import |
|
|
|
|
|
|
Quick Task 002: Auto-rename Duplicate Playlists on Import Summary
One-liner: CountPlaylistsByName query + uniquePlaylistName helper auto-appends (1), (2), etc. on M3U import when name collides
What Was Done
Task 1: Add CountPlaylistsByName SQL query and regenerate sqlc
- Added
CountPlaylistsByName :onequery toplaylists.sql— counts playlists with exact name match - Regenerated sqlc producing
CountPlaylistsByName(ctx, name) (int64, error)in Go - Commit:
04b2088
Task 2: Add uniquePlaylistName helper and wire into ImportPlaylist
- Added
uniquePlaylistName(name string) stringmethod to playlist Service - Logic: if name exists, tries "Name (1)", "Name (2)", etc. until a free name is found
- Wired single call
playlistName = s.uniquePlaylistName(playlistName)in ImportPlaylist, between name derivation and CreatePlaylist call - CreatePlaylist and CreatePlaylistWithTracks remain unchanged — no auto-rename on manual creation
- Commit:
8ba8bbe
Verification Results
| Check | Result |
|---|---|
go build ./backend/... |
✅ Pass |
go vet ./backend/... |
✅ Pass |
| CountPlaylistsByName in generated Go | ✅ Present |
| uniquePlaylistName only in ImportPlaylist | ✅ 3 occurrences (comment, definition, one call site) |
| CreatePlaylist unchanged | ✅ No uniquePlaylistName reference |
| CreatePlaylistWithTracks unchanged | ✅ No uniquePlaylistName reference |
Deviations from Plan
None — plan executed exactly as written.
Commits
| # | Hash | Message |
|---|---|---|
| 1 | 04b2088 |
feat(quick-002): add CountPlaylistsByName SQL query and regenerate sqlc |
| 2 | 8ba8bbe |
feat(quick-002): add uniquePlaylistName helper and wire into ImportPlaylist |