Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the repository URL #3192

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
Improve code style
  • Loading branch information
Garanas committed Jun 2, 2024
commit 67e5a064873d3e38d886b9898618a819dbd993ef
11 changes: 4 additions & 7 deletions src/main/java/com/faforever/client/mod/ModUploadTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,16 @@
.zip();
}

// retrieve information from the mod_info.lua to send to the API
ModVersion modVersionInfo = modService.extractModInfo(modPath);
if (modVersionInfo != null) {

}
URL repositoryURL = modVersionInfo.mod().repositoryURL();

log.debug("Uploading mod `{}` as `{}`", modPath, tmpFile);
updateTitle(i18n.get("modVault.upload.uploading"));

// retrieve information from `mod_info.lua`
ModVersion modVersionInfo = modService.extractModInfo(modPath);
URL repositoryURL = modVersionInfo.mod().repositoryURL();

HashMap<String, String> parameters = new HashMap<>();
if (repositoryURL != null) {
parameters.put("repositoryUrl", repositoryURL.toString());

Check warning on line 87 in src/main/java/com/faforever/client/mod/ModUploadTask.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/faforever/client/mod/ModUploadTask.java#L87

Added line #L87 was not covered by tests
}

return fafApiAccessor.uploadFile("/mods/upload", tmpFile, byteListener, Map.of("metadata", parameters)).block();
Expand Down
Loading