Alternative names for soundtracks #32

Open
opened 2026-10-09 16:04:07 +02:00 by Sansan · 0 comments
Owner

Let a soundtrack have alternative names (e.g. "FF7", "Final Fantasy VII", "ファイナルファンタジーVII"), so searching finds it by any of them and the cover search has better titles to try.

Plan

  • Migration. Add alternative_names TEXT[] NOT NULL DEFAULT '{}' to soundtrack. A separate soundtrack_alias table is also possible if names need their own data, but an array is enough for search. Update the sqlc queries.
  • Endpoint. PUT /api/v1/soundtracks/{uuid}/alternative-names with {"names": [...]} replaces the list. It trims and deduplicates the names and drops any that equal the soundtrack name. Needs a token like the other write endpoints.
  • Responses. Include alternative_names in the soundtrack, statistics (/statistics/...soundtracks) and soundtrack list responses. Update openapi.json, so the client's generated types (tools/generate_api_types.gd) pick it up.
  • Search.
    • SearchCache and /find match alternative names too.
    • Results still show the real soundtrack name, with the name that matched, so the user sees why it matched.
  • Sync.
    • A sync must keep the names when a soundtrack is re-added or renamed (matched by hash).
    • ResetDB drops them like everything else.
  • Cover search. Try the alternative names when fetching covers (cover art issue #12).

Used by

  • MusicPlayer: an edit button in the soundtrack statistics popup, and search in the app, Sansan/MusicPlayer#49.
Let a soundtrack have alternative names (e.g. "FF7", "Final Fantasy VII", "ファイナルファンタジーVII"), so searching finds it by any of them and the cover search has better titles to try. ## Plan - **Migration.** Add `alternative_names TEXT[] NOT NULL DEFAULT '{}'` to `soundtrack`. A separate `soundtrack_alias` table is also possible if names need their own data, but an array is enough for search. Update the sqlc queries. - **Endpoint.** `PUT /api/v1/soundtracks/{uuid}/alternative-names` with `{"names": [...]}` replaces the list. It trims and deduplicates the names and drops any that equal the soundtrack name. Needs a token like the other write endpoints. - **Responses.** Include `alternative_names` in the soundtrack, statistics (`/statistics/...soundtracks`) and soundtrack list responses. Update `openapi.json`, so the client's generated types (`tools/generate_api_types.gd`) pick it up. - **Search.** - `SearchCache` and `/find` match alternative names too. - Results still show the real soundtrack name, with the name that matched, so the user sees why it matched. - **Sync.** - A sync must keep the names when a soundtrack is re-added or renamed (matched by hash). - `ResetDB` drops them like everything else. - **Cover search.** Try the alternative names when fetching covers (cover art issue #12). ## Used by - MusicPlayer: an edit button in the soundtrack statistics popup, and search in the app, Sansan/MusicPlayer#49.
Sansan added the feature label 2026-10-09 16:04:07 +02:00
Sansan added the area/library label 2026-10-15 21:56:57 +02:00
Sign in to join this conversation.