diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 8f0753d75..9b50255fe 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -101,12 +101,16 @@ namespace NzbDrone.Web.Controllers FileSharingTalkUid = _configProvider.FileSharingTalkUid, FileSharingTalkSecret = _configProvider.FileSharingTalkSecret, + OmgwtfnzbsUsername = _configProvider.OmgwtfnzbsUsername, + OmgwtfnzbsApiKey = _configProvider.OmgwtfnzbsApiKey, + NzbsRUsEnabled = _indexerProvider.GetSettings(typeof(NzbsRUs)).Enable, NewznabEnabled = _indexerProvider.GetSettings(typeof(Newznab)).Enable, WomblesEnabled = _indexerProvider.GetSettings(typeof(Wombles)).Enable, FileSharingTalkEnabled = _indexerProvider.GetSettings(typeof(FileSharingTalk)).Enable, NzbIndexEnabled = _indexerProvider.GetSettings(typeof(NzbIndex)).Enable, NzbClubEnabled = _indexerProvider.GetSettings(typeof(NzbClub)).Enable, + OmgwtfnzbsEnabled = _indexerProvider.GetSettings(typeof(Omgwtfnzbs)).Enable, RssSyncInterval = _configProvider.RssSyncInterval, @@ -395,12 +399,19 @@ namespace NzbDrone.Web.Controllers nzbClubSettings.Enable = data.NzbClubEnabled; _indexerProvider.SaveSettings(nzbClubSettings); + var omgwtfnzbsSettings = _indexerProvider.GetSettings(typeof(Omgwtfnzbs)); + omgwtfnzbsSettings.Enable = data.OmgwtfnzbsEnabled; + _indexerProvider.SaveSettings(omgwtfnzbsSettings); + _configProvider.NzbsrusUId = data.NzbsrusUId; _configProvider.NzbsrusHash = data.NzbsrusHash; _configProvider.FileSharingTalkUid = data.FileSharingTalkUid; _configProvider.FileSharingTalkSecret = data.FileSharingTalkSecret; + _configProvider.OmgwtfnzbsUsername = data.OmgwtfnzbsUsername; + _configProvider.OmgwtfnzbsApiKey = data.OmgwtfnzbsApiKey; + //Save the interval to config and immediately apply it the the job (to avoid a restart) _configProvider.RssSyncInterval = data.RssSyncInterval; diff --git a/NzbDrone.Web/Models/IndexerSettingsModel.cs b/NzbDrone.Web/Models/IndexerSettingsModel.cs index 2cbc4ba6b..60c2b09fb 100644 --- a/NzbDrone.Web/Models/IndexerSettingsModel.cs +++ b/NzbDrone.Web/Models/IndexerSettingsModel.cs @@ -37,6 +37,20 @@ namespace NzbDrone.Web.Models [RequiredIf("FileSharingTalkEnabled", true, ErrorMessage = "Password Secret Required when File Sharing Talk is enabled")] public String FileSharingTalkSecret { get; set; } + [DataType(DataType.Text)] + [DisplayName("Username")] + [Description("Username for omgwtfnzbs")] + [DisplayFormat(ConvertEmptyStringToNull = false)] + [RequiredIf("OmgwtfnzbsEnabled", true, ErrorMessage = "Username is required when omgwtfnzbs is enabled")] + public String OmgwtfnzbsUsername { get; set; } + + [DataType(DataType.Text)] + [DisplayName("API Key")] + [Description("API Key for omgwtfnzbs")] + [DisplayFormat(ConvertEmptyStringToNull = false)] + [RequiredIf("OmgwtfnzbsEnabled", true, ErrorMessage = "API Key is required when omgwtfnzbs is enabled")] + public String OmgwtfnzbsApiKey { get; set; } + [DisplayName("NZBsRUs")] [Description("Enable downloading episodes from NZBsRus")] public bool NzbsRUsEnabled { get; set; } @@ -61,6 +75,10 @@ namespace NzbDrone.Web.Models [Description("Enable downloading episodes from NzbClub")] public bool NzbClubEnabled { get; set; } + [DisplayName("omgwtfnzbs")] + [Description("Enable downloading episodes from omgwtfnzbs")] + public bool OmgwtfnzbsEnabled { get; set; } + [Required(ErrorMessage = "Please enter a valid number of days")] [DataType(DataType.Text)] [DisplayName("Retention")] diff --git a/NzbDrone.Web/Views/Settings/Indexers.cshtml b/NzbDrone.Web/Views/Settings/Indexers.cshtml index 66c216b62..bb1aebae2 100644 --- a/NzbDrone.Web/Views/Settings/Indexers.cshtml +++ b/NzbDrone.Web/Views/Settings/Indexers.cshtml @@ -28,7 +28,10 @@ @Html.CheckBox("nzbClubStatus", @Model.NzbClubEnabled, new { @class = "indexerStatusButton" }) - + + + @Html.CheckBox("omgwtfnzbsStatus", @Model.OmgwtfnzbsEnabled, new { @class = "indexerStatusButton" }) +
@using (Html.BeginForm("SaveIndexers", "Settings", FormMethod.Post, new { id = "IndexersForm", name = "IndexersForm", @class = "settingsForm" })) @@ -117,6 +120,25 @@ @Html.CheckBoxFor(m => m.NzbClubEnabled, new { @class = "inputClass checkClass enabledCheck" })
+ +

omgwtfnzbs

+
+ + @Html.CheckBoxFor(m => m.OmgwtfnzbsEnabled, new { @class = "inputClass checkClass enabledCheck" }) + + + @Html.TextBoxFor(m => m.OmgwtfnzbsUsername, new { @class = "inputClass" }) + + @Html.TextBoxFor(m => m.OmgwtfnzbsApiKey, new { @class = "inputClass" }) +
@@ -191,6 +213,9 @@ if (id == 'NzbClubEnabled') $('#nzbClubStatus').prop('checked', checked); + + if (id == 'OmgwtfnzbsEnabled') + $('#omgwtfnzbsStatus').prop('checked', checked); $('.indexerStatusButton').button("refresh"); reValidate(); @@ -217,6 +242,9 @@ if (id == 'nzbClubStatus') $('#NzbClubEnabled').prop('checked', checked); + + if (id == 'omgwtfnzbsStatus') + $('#OmgwtfnzbsEnabled').prop('checked', checked); reValidate(); });