Skip to content

Commit

Permalink
Fix trailing slash bug when configuring external tools
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherp committed Feb 18, 2024
1 parent 93990b0 commit 6c53be5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ public void deleteOldResults() {
Optional<Integer> optionalHighestId;
Instant deleteOlderThanHistory;
if (keepHistory) {
logger.info("Starting deletion of old history entries");
deleteOlderThanHistory = Instant.now().minus(keepSearchResultsForWeeks * 7, ChronoUnit.DAYS);
int keepDays = keepSearchResultsForWeeks * 7;
logger.info("Starting deletion of old history entries older than {} days", keepDays);
deleteOlderThanHistory = Instant.now().minus(keepDays, ChronoUnit.DAYS);
optionalHighestId = getIdBefore(deleteOlderThanHistory, "SEARCH", ASC_DESC.DESC, connection);
} else {
optionalHighestId = Optional.of(Integer.MAX_VALUE);
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/static/js/nzbhydra.js
Original file line number Diff line number Diff line change
Expand Up @@ -5901,6 +5901,7 @@ function ConfigService($http, $q, $cacheFactory, $uibModal, bootstrapped, Reques
growl.error("No usenet or torrent indexers configured");
}


$scope.nzbhydraName = "NZBHydra2";
$scope.xdarrHost = "http://localhost:"
$scope.addType = "SINGLE";
Expand All @@ -5916,7 +5917,7 @@ function ConfigService($http, $q, $cacheFactory, $uibModal, bootstrapped, Reques
$scope.xdarrHost += "8989";
$scope.categories = "5030,5040";
if (externalTool === "Sonarrv3") {
$scope.externalToolDisplayName = "Sonarr v3";
$scope.externalToolDisplayName = "Sonarr v3+";
}
} else if (externalTool === "Radarr" || externalTool === "Radarrv3") {
$scope.xdarrHost += "7878";
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/static/js/nzbhydra.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion core/ui-src/js/config/config-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ function ConfigService($http, $q, $cacheFactory, $uibModal, bootstrapped, Reques
growl.error("No usenet or torrent indexers configured");
}


$scope.nzbhydraName = "NZBHydra2";
$scope.xdarrHost = "http://localhost:"
$scope.addType = "SINGLE";
Expand All @@ -153,7 +154,7 @@ function ConfigService($http, $q, $cacheFactory, $uibModal, bootstrapped, Reques
$scope.xdarrHost += "8989";
$scope.categories = "5030,5040";
if (externalTool === "Sonarrv3") {
$scope.externalToolDisplayName = "Sonarr v3";
$scope.externalToolDisplayName = "Sonarr v3+";
}
} else if (externalTool === "Radarr" || externalTool === "Radarrv3") {
$scope.xdarrHost += "7878";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import lombok.Data;
import org.nzbhydra.springnative.ReflectionMarker;
import org.springframework.util.StringUtils;

@Data
@ReflectionMarker
Expand Down Expand Up @@ -82,4 +83,8 @@ public boolean isV3() {
private Integer priority;
private boolean useHydraPriorities;

public String getXdarrHost() {
return
StringUtils.trimTrailingCharacter(xdarrHost, '/');
}
}

0 comments on commit 6c53be5

Please sign in to comment.