mirror of
https://github.com/rommapp/romm.git
synced 2026-12-05 05:07:31 +01:00
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