mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-21 23:51:29 +01:00
Changed Player data export path
Previous path did not match the path used in player.html, leading to the path not being replaced in the exported files. Now the new path should be replaced into the files, allowing people to view exported player.html data. Affects issues: - Fixed #1223
This commit is contained in:
parent
85401b37f2
commit
852ffb81e6
@ -87,7 +87,7 @@ public class PlayerPageExporter extends FileExporter {
|
|||||||
exportRequiredResources(toDirectory);
|
exportRequiredResources(toDirectory);
|
||||||
|
|
||||||
Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerName));
|
Path playerDirectory = toDirectory.resolve("player/" + toFileName(playerName));
|
||||||
exportJSON(playerDirectory, playerUUID);
|
exportJSON(playerDirectory, playerUUID, playerName);
|
||||||
exportHtml(playerDirectory, playerUUID);
|
exportHtml(playerDirectory, playerUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,11 +102,11 @@ public class PlayerPageExporter extends FileExporter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exportJSON(Path toDirectory, UUID playerUUID) throws IOException, NotFoundException {
|
private void exportJSON(Path toDirectory, UUID playerUUID, String playerName) throws IOException, NotFoundException {
|
||||||
exportJSON(toDirectory, "player?player=" + playerUUID);
|
exportJSON(toDirectory, "player?player=" + playerUUID, playerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exportJSON(Path toDirectory, String resource) throws NotFoundException, IOException {
|
private void exportJSON(Path toDirectory, String resource, String playerName) throws NotFoundException, IOException {
|
||||||
Response found = getJSONResponse(resource);
|
Response found = getJSONResponse(resource);
|
||||||
if (found instanceof ErrorResponse) {
|
if (found instanceof ErrorResponse) {
|
||||||
throw new NotFoundException(resource + " was not properly exported: " + found.getContent());
|
throw new NotFoundException(resource + " was not properly exported: " + found.getContent());
|
||||||
@ -115,7 +115,7 @@ public class PlayerPageExporter extends FileExporter {
|
|||||||
String jsonResourceName = toFileName(toJSONResourceName(resource)) + ".json";
|
String jsonResourceName = toFileName(toJSONResourceName(resource)) + ".json";
|
||||||
|
|
||||||
export(toDirectory.resolve(jsonResourceName), found.getContent());
|
export(toDirectory.resolve(jsonResourceName), found.getContent());
|
||||||
exportPaths.put("../v1/" + resource, "./" + jsonResourceName);
|
exportPaths.put("../v1/player?player=" + playerName, "./" + jsonResourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String toJSONResourceName(String resource) {
|
private String toJSONResourceName(String resource) {
|
||||||
|
Loading…
Reference in New Issue
Block a user