2013-05-20 02:17:32 +03:00
|
|
|
using System;
|
2013-07-18 10:08:32 +03:00
|
|
|
using System.ComponentModel;
|
2013-06-12 09:45:25 +03:00
|
|
|
using Newtonsoft.Json;
|
2013-05-20 02:17:32 +03:00
|
|
|
using NzbDrone.Core.Annotations;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Notifications.Xbmc
|
|
|
|
{
|
|
|
|
public class XbmcSettings : INotifcationSettings
|
|
|
|
{
|
2013-07-18 10:08:32 +03:00
|
|
|
public XbmcSettings()
|
|
|
|
{
|
|
|
|
DisplayTime = 5;
|
|
|
|
}
|
|
|
|
|
2013-05-20 07:19:54 +03:00
|
|
|
[FieldDefinition(0, Label = "Host")]
|
2013-05-20 02:17:32 +03:00
|
|
|
public String Host { get; set; }
|
|
|
|
|
2013-05-20 07:19:54 +03:00
|
|
|
[FieldDefinition(1, Label = "Port")]
|
2013-05-20 02:17:32 +03:00
|
|
|
public Int32 Port { get; set; }
|
|
|
|
|
2013-05-20 07:19:54 +03:00
|
|
|
[FieldDefinition(2, Label = "Username")]
|
2013-05-20 02:17:32 +03:00
|
|
|
public String Username { get; set; }
|
|
|
|
|
2013-05-20 07:19:54 +03:00
|
|
|
[FieldDefinition(3, Label = "Password", Type = FieldType.Password)]
|
2013-05-20 02:17:32 +03:00
|
|
|
public String Password { get; set; }
|
|
|
|
|
2013-07-18 10:08:32 +03:00
|
|
|
[DefaultValue(5)]
|
|
|
|
[FieldDefinition(4, Label = "Display Time", HelpText = "How long the notification will be displayed for (In seconds)")]
|
|
|
|
public Int32 DisplayTime { get; set; }
|
|
|
|
|
|
|
|
[FieldDefinition(5, Label = "GUI Notification", HelpText = "Show GUI notifications?", Type = FieldType.Checkbox)]
|
2013-05-20 07:19:54 +03:00
|
|
|
public Boolean Notify { get; set; }
|
|
|
|
|
2013-07-18 10:08:32 +03:00
|
|
|
[FieldDefinition(6, Label = "Update Library", HelpText = "Update Library on Download & Rename?", Type = FieldType.Checkbox)]
|
2013-05-20 02:17:32 +03:00
|
|
|
public Boolean UpdateLibrary { get; set; }
|
|
|
|
|
2013-07-18 10:08:32 +03:00
|
|
|
[FieldDefinition(7, Label = "Clean Library", HelpText = "Clean Library after update?", Type = FieldType.Checkbox)]
|
2013-05-20 02:17:32 +03:00
|
|
|
public Boolean CleanLibrary { get; set; }
|
|
|
|
|
2013-07-18 10:08:32 +03:00
|
|
|
[FieldDefinition(8, Label = "Always Update", HelpText = "Update Library even when a video is playing?", Type = FieldType.Checkbox)]
|
2013-05-20 02:17:32 +03:00
|
|
|
public Boolean AlwaysUpdate { get; set; }
|
|
|
|
|
2013-06-12 09:45:25 +03:00
|
|
|
[JsonIgnore]
|
|
|
|
public String Address { get { return String.Format("{0}:{1}", Host, Port); } }
|
|
|
|
|
2013-05-20 02:17:32 +03:00
|
|
|
public bool IsValid
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return !string.IsNullOrWhiteSpace(Host) && Port > 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|