1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core/Notifications/Xbmc/XbmcSettings.cs

55 lines
1.8 KiB
C#
Raw Normal View History

2013-05-20 02:17:32 +03:00
using System;
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
{
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; }
[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; }
[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; }
[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; }
[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;
}
}
}
}