mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +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)));
|
.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()));
|
DetectedGame game = gameMapper.toDetectedGame(igdbGame, Path.of(unmappableFile.getPath()));
|
||||||
|
game.setConfirmedMatch(true);
|
||||||
|
|
||||||
game = detectedGameRepository.save(game);
|
game = detectedGameRepository.save(game);
|
||||||
|
|
||||||
unmappableFileRepository.delete(unmappableFile);
|
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)));
|
.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()));
|
DetectedGame game = gameMapper.toDetectedGame(igdbGame, Path.of(existingGame.getPath()));
|
||||||
|
game.setConfirmedMatch(true);
|
||||||
|
|
||||||
game = detectedGameRepository.save(game);
|
game = detectedGameRepository.save(game);
|
||||||
|
|
||||||
|
detectedGameRepository.delete(existingGame);
|
||||||
|
|
||||||
return game;
|
return game;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "1.2.4-SNAPSHOT",
|
"version": "1.2.5-SNAPSHOT",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "1.2.4-SNAPSHOT",
|
"version": "1.2.5-SNAPSHOT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^14.0.0",
|
"@angular/animations": "^14.0.0",
|
||||||
"@angular/cdk": "^14.1.0",
|
"@angular/cdk": "^14.1.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend",
|
"name": "frontend",
|
||||||
"version": "1.2.4-SNAPSHOT",
|
"version": "1.2.5-SNAPSHOT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
|||||||
Reference in New Issue
Block a user