Skip to content

Commit

Permalink
Fix wrong path separator being used when adding content (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
shayaantx authored Jun 25, 2023
1 parent 7a9b0e0 commit 413e2d9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ on:
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- '**'
- '!development'
- 'development'
push:
branches:
- '**'
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/botdarr/api/lidarr/LidarrApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.logging.log4j.LogManager;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -235,7 +236,7 @@ public List<LidarrArtist> onSuccess(String response) {

private CommandResponse addArtist(LidarrArtist lidarrArtist) {
lidarrArtist.setMonitored(true);
lidarrArtist.setRootFolderPath(Config.getProperty(Config.Constants.LIDARR_PATH) + "/");
lidarrArtist.setRootFolderPath(Config.getProperty(Config.Constants.LIDARR_PATH) + File.separator);

String lidarrProfileName = Config.getProperty(Config.Constants.LIDARR_DEFAULT_QUALITY_PROFILE);
LidarrQualityProfile lidarrQualityProfile = LIDARR_CACHE.getQualityProfile(lidarrProfileName.toLowerCase());
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/botdarr/api/sonarr/SonarrApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.logging.log4j.LogManager;

import java.io.File;
import java.io.IOException;
import java.util.*;

Expand Down Expand Up @@ -302,7 +303,7 @@ public List<CommandResponse> onSuccess(String response) {
private CommandResponse addShow(SonarrShow sonarrShow) {
String title = sonarrShow.getTitle();
//make sure we specify where the show should get downloaded
sonarrShow.setPath(Config.getProperty(Config.Constants.SONARR_PATH) + "/" + title);
sonarrShow.setPath(Config.getProperty(Config.Constants.SONARR_PATH) + File.separator + title);
//make sure the show is monitored
sonarrShow.setMonitored(true);
//make sure to have seasons stored in separate folders
Expand All @@ -325,8 +326,7 @@ private CommandResponse addShow(SonarrShow sonarrShow) {
String json = new GsonBuilder().addSerializationExclusionStrategy(excludeUnnecessaryFields).create().toJson(sonarrShow, SonarrShow.class);
HttpRequestBase post = new SonarrUrls.SonarrRequestBuilder().buildPost(SonarrUrls.SERIES_BASE, json).build();

//TODO: why isn't the content type json
post.addHeader("content-type", "application/x-www-form-urlencoded");
post.addHeader("content-type", "application/json");

try (CloseableHttpResponse response = client.execute(post)) {
int statusCode = response.getStatusLine().getStatusCode();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.7
5.6.8

0 comments on commit 413e2d9

Please sign in to comment.