New: Adds SSL option to Kodi connections (#6219)

This commit is contained in:
Robin Dadswell 2021-04-24 18:43:26 +01:00 committed by GitHub
parent c66f7abea5
commit 7c5fc1e4b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

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

View File

@ -32,26 +32,29 @@ namespace NzbDrone.Core.Notifications.Xbmc
[FieldDefinition(1, Label = "Port")]
public int Port { get; set; }
[FieldDefinition(2, Label = "Username", Privacy = PrivacyLevel.UserName)]
[FieldDefinition(2, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Connect to Kodi over HTTPS instead of HTTP")]
public bool UseSsl { get; set; }
[FieldDefinition(3, Label = "Username", Privacy = PrivacyLevel.UserName)]
public string Username { get; set; }
[FieldDefinition(3, Label = "Password", Type = FieldType.Password, Privacy = PrivacyLevel.Password)]
[FieldDefinition(4, Label = "Password", Type = FieldType.Password, Privacy = PrivacyLevel.Password)]
public string Password { get; set; }
[DefaultValue(5)]
[FieldDefinition(4, Label = "Display Time", HelpText = "How long the notification will be displayed for (In seconds)")]
[FieldDefinition(5, Label = "Display Time", HelpText = "How long the notification will be displayed for (In seconds)")]
public int DisplayTime { get; set; }
[FieldDefinition(5, Label = "GUI Notification", Type = FieldType.Checkbox)]
[FieldDefinition(6, Label = "GUI Notification", Type = FieldType.Checkbox)]
public bool Notify { get; set; }
[FieldDefinition(6, Label = "Update Library", HelpText = "Update Library on Import & Rename?", Type = FieldType.Checkbox)]
[FieldDefinition(7, Label = "Update Library", HelpText = "Update Library on Import & Rename?", Type = FieldType.Checkbox)]
public bool UpdateLibrary { get; set; }
[FieldDefinition(7, Label = "Clean Library", HelpText = "Clean Library after update?", Type = FieldType.Checkbox)]
[FieldDefinition(8, Label = "Clean Library", HelpText = "Clean Library after update?", Type = FieldType.Checkbox)]
public bool CleanLibrary { get; set; }
[FieldDefinition(8, Label = "Always Update", HelpText = "Update Library even when a video is playing?", Type = FieldType.Checkbox)]
[FieldDefinition(9, Label = "Always Update", HelpText = "Update Library even when a video is playing?", Type = FieldType.Checkbox)]
public bool AlwaysUpdate { get; set; }
[JsonIgnore]