fix(library): merge manual game into its Steam row on sync

Steam sync added a second row for a game the user added by hand (#9).
The manual row moves to the Steam appid and keeps its data, such as
status, notes, sets and PSN links. Manual rows on other platforms stay
and join the Steam game's set.
This commit is contained in:
lobo committed 2026-10-11 14:55:09 +02:00
1 parent 59d6b3394d
commit 1de8acef2e
8 files changed
+720 -9

No files matched your search

+6
View File
@@ -402,6 +402,12 @@ Inside a module: `api` (controllers, DTOs), `service` (business logic), `domain`
no old playtime, and one game gets at most 24 hours per day. Steam's `rtime_last_played` (unix seconds, 0 = never)
is stored in `user_game.last_played_at`; a missing or zero value keeps the old one. A BACKLOG game with new playtime becomes PLAYING, unless the user chose its status. When Steam returns no
games, the library stays as it is.
A game the user added by hand for PC, Steam, Mac or Linux (or with no platform), whose IGDB game is the IGDB
game of a Steam appid the user owns for the first time (`game_edition`), becomes that Steam row. The row moves
from minus its IGDB id to the appid and keeps status, rating, notes, priority, status history, backlog
position, questions, set rows, PlayStation links and paid game rewards. Playtime and last played come from
Steam. A hand-added game on another platform stays and joins the Steam game's set. A user with such a game
gets the IGDB edition refresh before the save, so the mapping is known in time.
5. `TimeToBeatService` and `MoodService` ask IGDB for missing or old time-to-beat, mood and genre data, for Steam
games and manual games. Hidden games only get their playtime updated.
6. After the commit, `LibrarySyncedEvent` starts `AchievementSyncService` and `SpeedrunService` (backlog games only)