mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-15 16:20:03 +00:00
[GH-61] Fix manual mapping leading to duplicates in DB
This commit is contained in:
@@ -105,6 +105,8 @@ public class GameService {
|
||||
.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Game with slug '%s' does not exist on IGDB.".formatted(slug)));
|
||||
|
||||
DetectedGame game = gameMapper.toDetectedGame(igdbGame, Path.of(unmappableFile.getPath()));
|
||||
game.setConfirmedMatch(true);
|
||||
|
||||
game = detectedGameRepository.save(game);
|
||||
|
||||
unmappableFileRepository.delete(unmappableFile);
|
||||
@@ -117,8 +119,12 @@ public class GameService {
|
||||
.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND, "Game with slug '%s' does not exist on IGDB.".formatted(slug)));
|
||||
|
||||
DetectedGame game = gameMapper.toDetectedGame(igdbGame, Path.of(existingGame.getPath()));
|
||||
game.setConfirmedMatch(true);
|
||||
|
||||
game = detectedGameRepository.save(game);
|
||||
|
||||
detectedGameRepository.delete(existingGame);
|
||||
|
||||
return game;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user