Did the notification side of things with the custom user defined preference !wip

This commit is contained in:
TidusJar 2018-09-18 15:51:22 +01:00
parent de2e3abfe0
commit 8573b7c729
12 changed files with 41 additions and 22 deletions

View file

@ -14,9 +14,10 @@ namespace Ombi.Notifications
{
public class NotificationMessageCurlys
{
public void Setup(NotificationOptions opts, FullBaseRequest req, CustomizationSettings s)
public void Setup(NotificationOptions opts, FullBaseRequest req, CustomizationSettings s, UserNotificationPreferences pref)
{
LoadIssues(opts);
UserPreference = pref.Enabled ? pref.Value : string.Empty;
string title;
if (req == null)
{
@ -58,9 +59,10 @@ namespace Ombi.Notifications
AdditionalInformation = opts?.AdditionalInformation ?? string.Empty;
}
public void Setup(NotificationOptions opts, AlbumRequest req, CustomizationSettings s)
public void Setup(NotificationOptions opts, AlbumRequest req, CustomizationSettings s, UserNotificationPreferences pref)
{
LoadIssues(opts);
UserPreference = pref.Enabled ? pref.Value : string.Empty;
string title;
if (req == null)
{
@ -101,9 +103,10 @@ namespace Ombi.Notifications
Alias = username.Alias.HasValue() ? username.Alias : username.UserName;
}
public void Setup(NotificationOptions opts, ChildRequests req, CustomizationSettings s)
public void Setup(NotificationOptions opts, ChildRequests req, CustomizationSettings s, UserNotificationPreferences pref)
{
LoadIssues(opts);
UserPreference = pref.Enabled ? pref.Value : string.Empty;
string title;
if (req == null)
{
@ -221,6 +224,7 @@ namespace Ombi.Notifications
public string IssueStatus { get; set; }
public string IssueSubject { get; set; }
public string NewIssueComment { get; set; }
public string UserPreference { get; set; }
// System Defined
private string LongDate => DateTime.Now.ToString("D");