diff --git a/src/main/java/org/araymond/joal/core/config/AppConfiguration.java b/src/main/java/org/araymond/joal/core/config/AppConfiguration.java index 463dbcfd..339da3b2 100644 --- a/src/main/java/org/araymond/joal/core/config/AppConfiguration.java +++ b/src/main/java/org/araymond/joal/core/config/AppConfiguration.java @@ -29,14 +29,14 @@ public AppConfiguration( @JsonProperty(value = "simultaneousSeed", required = true) final int simultaneousSeed, @JsonProperty(value = "client", required = true) final String client, @JsonProperty(value = "keepTorrentWithZeroLeechers", required = true) final boolean keepTorrentWithZeroLeechers, - @JsonProperty(value = "uploadRatioTarget", defaultValue = "-1.0", required = false) final float uploadRatioTarget + @JsonProperty(value = "uploadRatioTarget", required = false) final Float uploadRatioTarget ) { this.minUploadRate = minUploadRate; this.maxUploadRate = maxUploadRate; this.simultaneousSeed = simultaneousSeed; this.client = client; this.keepTorrentWithZeroLeechers = keepTorrentWithZeroLeechers; - this.uploadRatioTarget = uploadRatioTarget; + this.uploadRatioTarget = uploadRatioTarget == null ? -1.0f : uploadRatioTarget; validate(); } diff --git a/src/main/java/org/araymond/joal/web/messages/incoming/config/ConfigIncomingMessage.java b/src/main/java/org/araymond/joal/web/messages/incoming/config/ConfigIncomingMessage.java index 12ba7a33..b8c10c26 100644 --- a/src/main/java/org/araymond/joal/web/messages/incoming/config/ConfigIncomingMessage.java +++ b/src/main/java/org/araymond/joal/web/messages/incoming/config/ConfigIncomingMessage.java @@ -27,14 +27,14 @@ public class ConfigIncomingMessage { @JsonProperty(value = "simultaneousSeed", required = true) final Integer simultaneousSeed, @JsonProperty(value = "client", required = true) final String client, @JsonProperty(value = "keepTorrentWithZeroLeechers", required = true) final boolean keepTorrentWithZeroLeechers, - @JsonProperty(value = "uploadRatioTarget", defaultValue = "-1.0", required = false) final Float uploadRatioTarget + @JsonProperty(value = "uploadRatioTarget", required = false) final Float uploadRatioTarget ) { this.minUploadRate = minUploadRate; this.maxUploadRate = maxUploadRate; this.simultaneousSeed = simultaneousSeed; this.client = client; this.keepTorrentWithZeroLeechers = keepTorrentWithZeroLeechers; - this.uploadRatioTarget = uploadRatioTarget; + this.uploadRatioTarget = uploadRatioTarget == null ? -1.0f : uploadRatioTarget; } public AppConfiguration toAppConfiguration() throws AppConfigurationIntegrityException {