|
|
@ -22,8 +22,8 @@ public class PreviewUpdater extends BaseUpdater{ |
|
|
|
private String domain = "tf2.pblr-nyk.pro"; |
|
|
|
private String preview = "https://%s/site_content/images/preview/%s.%s"; |
|
|
|
|
|
|
|
@Value("${backend.updates.a2s}") |
|
|
|
private boolean update = false; |
|
|
|
//@Value("${backend.updates.a2s}")
|
|
|
|
private boolean update = true; |
|
|
|
private HashMap<String, String> preview_cache; |
|
|
|
|
|
|
|
@Autowired |
|
|
@ -53,16 +53,16 @@ public class PreviewUpdater extends BaseUpdater{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (preview_cache.containsKey(server.getMap())) { |
|
|
|
if (preview_cache.get(server.getMap()).equals(server.getPreview())) return; |
|
|
|
if (preview_cache.containsKey(server.getMapCleared())) { |
|
|
|
if (preview_cache.get(server.getMapCleared()).equals(server.getPreview())) return; |
|
|
|
} |
|
|
|
|
|
|
|
String url = getPreview(server.getMap()); |
|
|
|
String url = getPreview(server.getMapCleared()); |
|
|
|
if (url != null) { |
|
|
|
server.setPreview(url); |
|
|
|
preview_cache.put(server.getMap(), server.getPreview()); |
|
|
|
preview_cache.put(server.getMapCleared(), server.getPreview()); |
|
|
|
} else { |
|
|
|
logger.warn("Not found preview for {}", server.getMap()); |
|
|
|
logger.warn("Not found preview for {}", server.getMapCleared()); |
|
|
|
server.setPreview(not_found()); |
|
|
|
} |
|
|
|
} |
|
|
|