diff --git a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoRequestGenerator.cs b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoRequestGenerator.cs index 8fc5a4947..8a29dd112 100644 --- a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoRequestGenerator.cs +++ b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoRequestGenerator.cs @@ -21,7 +21,13 @@ namespace NzbDrone.Core.NetImport.CouchPotato private IEnumerable GetMovies(string searchParameters) { - var request = new NetImportRequest($"{Settings.Link.Trim()}:{Settings.Port}/api/{Settings.ApiKey}/movie.list/?status=active", HttpAccept.Json); + var urlBase = ""; + if (!string.IsNullOrWhiteSpace(Settings.UrlBase)) + { + urlBase = Settings.UrlBase.StartsWith("/") ? Settings.UrlBase : $"/{Settings.UrlBase}"; + } + + var request = new NetImportRequest($"{Settings.Link.Trim()}:{Settings.Port}{urlBase}/api/{Settings.ApiKey}/movie.list/?status=active", HttpAccept.Json); yield return request; } } diff --git a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs index 15a6cf9cb..05744c825 100644 --- a/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs +++ b/src/NzbDrone.Core/NetImport/CouchPotato/CouchPotatoSettings.cs @@ -12,16 +12,20 @@ namespace NzbDrone.Core.NetImport.CouchPotato public CouchPotatoSettings() { Link = "http://localhost"; - Port = "5050"; + Port = 5050; + UrlBase = ""; } [FieldDefinition(0, Label = "CouchPotato URL", HelpText = "Link to your CoouchPootato.")] public new string Link { get; set; } [FieldDefinition(1, Label = "CouchPotato Port", HelpText = "Port your CoouchPootato uses.")] - public string Port { get; set; } + public int Port { get; set; } - [FieldDefinition(2, Label = "CouchPotato API Key", HelpText = "CoouchPootato API Key.")] + [FieldDefinition(2, Label = "CouchPotato Url Base", HelpText = "UrlBase your CoouchPootato uses, leave blank for none")] + public string UrlBase { get; set; } + + [FieldDefinition(3, Label = "CouchPotato API Key", HelpText = "CoouchPootato API Key.")] public string ApiKey { get; set; } } }