Files
romm/backend
Sam Dornan e40a9efced refactor(soundtrack): give each song its own track id
Favorites and playlist entries pointed at (rom_file_id, song), a position
the database couldn't enforce, so rescans had to move them by hand. Now
every track_meta row has its own id, and favorites and playlist entries
reference it with a cascading foreign key.

- track_meta: `id` primary key, unique (rom_file_id, song)
- music_favorite_tracks: (user_id, track_id); music_playlist_tracks:
  unique (playlist_id, track_id); both drop rom_file_id and song
- a rescan matches songs to their rows by tags, then position, and only
  renumbers the rows, so saved songs follow without extra bookkeeping
- the API takes `track_ids`, still accepting `rom_file_ids` for 5.3.1
  clients; tracks carry `id`
- the frontend keys favorites and queue entries by track id
- migration 0145 moves existing favorites and playlist entries onto
  their file's first song, and back again on downgrade

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A33pL6e6MvvBwhpcbXX9pH
2026-09-28 23:38:34 +00:00
..
2024-02-10 12:43:39 -05:00
2025-07-05 19:17:40 -04:00