package com.faforever.api.data.listeners;

import com.faforever.api.config.FafApiProperties;
import com.faforever.api.data.domain.Game;
import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.stereotype.Component;

import javax.inject.Inject;
import javax.persistence.PostLoad;

@Component
public class GameEnricher {

  private static FafApiProperties fafApiProperties;

  @Inject
  public void init(FafApiProperties fafApiProperties) {
    GameEnricher.fafApiProperties = fafApiProperties;
  }

  @PostLoad
  public void enrich(Game game) {
    game.setReplayUrl(String.format(fafApiProperties.getReplay().getDownloadUrlFormat(), game.getId()));
    game.setName(StringEscapeUtils.unescapeHtml4(game.getName()));
  }
}

@@ -65,31 +65,24 @@
 api.
-config.FafApiProperties
+data.domain.Game
 ;%0Aim
@@ -100,39 +100,39 @@
 forever.api.
-data.domain.Gam
+game.GameServic
 e;%0Aimport or
@@ -348,162 +348,132 @@
 tic 
-FafApiProperties fafApiProperties;%0A%0A  @Inject%0A  public void init(FafApiProperties fafApiProperties) %7B%0A    GameEnricher.fafApiProperties = fafApiProperties
+GameService gameService;%0A%0A  @Inject%0A  public void init(GameService gameService) %7B%0A    GameEnricher.gameService = gameService
 ;%0A  
@@ -547,38 +547,19 @@
 Url(
-String.format(fafApiProperties
+gameService
 .get
@@ -568,14 +568,8 @@
 play
-().get
 Down
@@ -579,18 +579,9 @@
 dUrl
-Format(), 
+(
 game

Fix broken replay url in game entity