Fixed: URL Base setting for Kodi connections

This commit is contained in:
Bogdan 2024-03-03 13:44:47 +02:00 committed by Mark McDowall
parent 0183812cc5
commit 2068c5393e
2 changed files with 5 additions and 3 deletions

View File

@ -75,7 +75,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
private string ProcessRequest(XbmcSettings settings, string method, params object[] parameters)
{
var url = HttpRequestBuilder.BuildBaseUrl(settings.UseSsl, settings.Host, settings.Port, "jsonrpc");
var url = HttpRequestBuilder.BuildBaseUrl(settings.UseSsl, settings.Host, settings.Port, settings.UrlBase);
var requestBuilder = new JsonRpcRequestBuilder(url, method, parameters);
requestBuilder.LogResponseContent = true;

View File

@ -14,16 +14,18 @@ namespace NzbDrone.Core.Notifications.Xbmc
{
RuleFor(c => c.Host).ValidHost();
RuleFor(c => c.DisplayTime).GreaterThanOrEqualTo(2);
RuleFor(c => c.UrlBase).ValidUrlBase();
}
}
public class XbmcSettings : IProviderConfig
{
private static readonly XbmcSettingsValidator Validator = new XbmcSettingsValidator();
private static readonly XbmcSettingsValidator Validator = new ();
public XbmcSettings()
{
Port = 8080;
UrlBase = "/jsonrpc";
DisplayTime = 5;
}
@ -65,7 +67,7 @@ namespace NzbDrone.Core.Notifications.Xbmc
public bool AlwaysUpdate { get; set; }
[JsonIgnore]
public string Address => $"{Host.ToUrlHost()}:{Port}";
public string Address => $"{Host.ToUrlHost()}:{Port}{UrlBase}";
public NzbDroneValidationResult Validate()
{