2011-04-10 02:44:01 +00:00
using System.ComponentModel ;
2011-03-07 07:32:36 +00:00
using System.ComponentModel.DataAnnotations ;
2011-11-03 02:44:22 +00:00
using System.Web.Mvc ;
2012-02-25 21:21:41 +00:00
using NzbDrone.Core.Model ;
using NzbDrone.Web.Helpers.Validation ;
2011-03-07 07:32:36 +00:00
namespace NzbDrone.Web.Models
{
public class NotificationSettingsModel
{
2011-10-27 05:46:54 +00:00
//XBMC
2011-03-07 07:32:36 +00:00
[DisplayName("Enabled")]
2011-07-01 20:33:03 +00:00
[Description("Enable notifications for XBMC?")]
2011-03-07 07:32:36 +00:00
public bool XbmcEnabled { get ; set ; }
[DisplayName("Notify on Grab")]
2011-07-01 20:33:03 +00:00
[Description("Send notification when episode is sent to SABnzbd?")]
2011-03-07 07:32:36 +00:00
public bool XbmcNotifyOnGrab { get ; set ; }
[DisplayName("Notify on Download")]
2011-07-01 20:33:03 +00:00
[Description("Send notification when episode is downloaded?")]
2011-03-07 07:32:36 +00:00
public bool XbmcNotifyOnDownload { get ; set ; }
2011-07-09 18:19:33 +00:00
[DisplayName("Update on Download and Rename")]
[Description("Update XBMC library after episode is downloaded or renamed?")]
public bool XbmcUpdateLibrary { get ; set ; }
2011-03-07 07:32:36 +00:00
2011-07-09 18:19:33 +00:00
[DisplayName("Clean on Download/Rename")]
[Description("Clean XBMC library after an episode is downloaded or renamed?")]
public bool XbmcCleanLibrary { get ; set ; }
2011-03-07 07:32:36 +00:00
[DataType(DataType.Text)]
[DisplayName("Hosts")]
2011-07-09 18:19:33 +00:00
[Description("XBMC hosts with port, comma separated")]
2011-03-07 07:32:36 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("XbmcEnabled", true, ErrorMessage = "Required when XBMC Notifications are enabled")]
2011-03-07 07:32:36 +00:00
public string XbmcHosts { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Username")]
2011-07-01 20:33:03 +00:00
[Description("XBMC webserver username")]
2011-03-07 07:32:36 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcUsername { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Password")]
2011-07-01 20:33:03 +00:00
[Description("XBMC webserver password")]
2011-03-07 07:32:36 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string XbmcPassword { get ; set ; }
2011-10-27 05:46:54 +00:00
2012-05-07 18:36:44 +00:00
[DisplayName("Always Update")]
[Description("Update Library even when a video is playing?")]
public bool XbmcUpdateWhenPlaying { get ; set ; }
2011-10-27 05:46:54 +00:00
//SMTP
[DisplayName("Enabled")]
2012-02-27 01:54:55 +00:00
[Description("Enable Email notifications?")]
2011-10-27 05:46:54 +00:00
public bool SmtpEnabled { get ; set ; }
[DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool SmtpNotifyOnGrab { get ; set ; }
[DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool SmtpNotifyOnDownload { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Server")]
[Description("SMTP Server Hostname")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("SmtpEnabled", true, ErrorMessage = "Required when SMTP Notifications are enabled")]
2011-10-27 05:46:54 +00:00
public string SmtpServer { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Port")]
[Description("SMTP Server Port")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("SmtpEnabled", true, ErrorMessage = "Required when SMTP Notifications are enabled")]
2011-10-27 05:46:54 +00:00
public int SmtpPort { get ; set ; }
[DisplayName("SSL")]
[Description("Does the SMTP Server use SSL?")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public bool SmtpUseSsl { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Username")]
[Description("SMTP Server authentication username")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string SmtpUsername { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Password")]
[Description("SMTP Server authentication password")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string SmtpPassword { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Send From Address")]
[Description("Sender Email address")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("SmtpEnabled", true, ErrorMessage = "Required when SMTP Notifications are enabled")]
2011-10-27 05:46:54 +00:00
public string SmtpFromAddress { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Send To Addresses")]
[Description("Comma separated list of addresses to email")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("SmtpEnabled", true, ErrorMessage = "Required when SMTP Notifications are enabled")]
2011-10-27 05:46:54 +00:00
public string SmtpToAddresses { get ; set ; }
2011-10-28 07:57:00 +00:00
//Twitter
[DisplayName("Enabled")]
[Description("Enable notifications for Twitter?")]
public bool TwitterEnabled { get ; set ; }
[DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool TwitterNotifyOnGrab { get ; set ; }
[DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool TwitterNotifyOnDownload { get ; set ; }
2011-11-02 07:09:52 +00:00
//Growl
[DisplayName("Enabled")]
[Description("Enable notifications for Growl?")]
public bool GrowlEnabled { get ; set ; }
[DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool GrowlNotifyOnGrab { get ; set ; }
[DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool GrowlNotifyOnDownload { get ; set ; }
2011-11-03 04:01:44 +00:00
[DataType(DataType.Text)]
2011-11-02 07:09:52 +00:00
[DisplayName("Host running Growl")]
[Description("Host or IP Address:Port")]
2011-11-03 04:01:44 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("GrowlEnabled", true, ErrorMessage = "Required when Growl Notifications are enabled")]
2011-11-02 07:09:52 +00:00
public string GrowlHost { get ; set ; }
2011-11-03 04:01:44 +00:00
[DataType(DataType.Text)]
2011-11-02 07:09:52 +00:00
[DisplayName("Growl host Password")]
[Description("Password is required if Growl is running on another system")]
2011-11-03 04:01:44 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
2011-11-02 07:09:52 +00:00
public string GrowlPassword { get ; set ; }
2011-11-03 02:44:22 +00:00
//Prowl
[DisplayName("Enabled")]
[Description("Enable notifications for Prowl?")]
public bool ProwlEnabled { get ; set ; }
[DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool ProwlNotifyOnGrab { get ; set ; }
[DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool ProwlNotifyOnDownload { get ; set ; }
2011-11-03 04:01:44 +00:00
[DataType(DataType.Text)]
2011-11-03 02:44:22 +00:00
[DisplayName("API Keys")]
[Description("Comma-Separated list of API Keys")]
2011-11-03 04:01:44 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("ProwlEnabled", true, ErrorMessage = "Required when Prowl Notifications are enabled")]
2011-11-03 02:44:22 +00:00
public string ProwlApiKeys { get ; set ; }
2011-11-03 04:01:44 +00:00
[DataType(DataType.Text)]
2011-11-03 02:44:22 +00:00
[DisplayName("Priority")]
[Description("Priority to send alerts to Prowl with")]
2011-11-03 04:01:44 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
2011-11-03 02:44:22 +00:00
public int ProwlPriority { get ; set ; }
public SelectList ProwlPrioritySelectList { get ; set ; }
2012-02-21 23:10:42 +00:00
//Plex
[DisplayName("Enabled")]
[Description("Enable notifications for Plex?")]
public bool PlexEnabled { get ; set ; }
[DisplayName("Notify on Grab")]
[Description("Send notification when episode is sent to SABnzbd?")]
public bool PlexNotifyOnGrab { get ; set ; }
[DisplayName("Notify on Download")]
[Description("Send notification when episode is downloaded?")]
public bool PlexNotifyOnDownload { get ; set ; }
[DisplayName("Update on Download and Rename")]
[Description("Update Plex library after episode is downloaded or renamed?")]
public bool PlexUpdateLibrary { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Server Host")]
[Description("Plex Server host with port")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
2012-02-25 21:21:41 +00:00
[RequiredIf("PlexUpdateLibrary", true, ErrorMessage = "Required when Plex Library Update is Enabled")]
2012-02-21 23:10:42 +00:00
public string PlexServerHost { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Client Hosts")]
[Description("Plex client hosts with port, comma separated for multiple clients")]
2012-02-25 22:20:43 +00:00
[RequiredIfAny(new string[] { "PlexNotifyOnGrab" , "PlexNotifyOnDownload" } , new object [ ] { true , true } , ErrorMessage = "Required when Plex Notifications are enabled" ) ]
2012-02-21 23:10:42 +00:00
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string PlexClientHosts { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Username")]
[Description("Plex client webserver username")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string PlexUsername { get ; set ; }
[DataType(DataType.Text)]
[DisplayName("Password")]
[Description("Plex client webserver password")]
[DisplayFormat(ConvertEmptyStringToNull = false)]
public string PlexPassword { get ; set ; }
2011-03-07 07:32:36 +00:00
}
}