mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Fixed #2109
This commit is contained in:
parent
c14fd64f5f
commit
b8739142ca
2 changed files with 22 additions and 4 deletions
|
@ -29,11 +29,19 @@ namespace Ombi.Notifications
|
||||||
ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty;
|
ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty;
|
||||||
ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName;
|
ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName;
|
||||||
RequestedUser = req?.RequestedUser?.UserName;
|
RequestedUser = req?.RequestedUser?.UserName;
|
||||||
|
if (UserName.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
// Can be set if it's an issue
|
||||||
UserName = req?.RequestedUser?.UserName;
|
UserName = req?.RequestedUser?.UserName;
|
||||||
|
}
|
||||||
|
|
||||||
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
|
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
|
||||||
Title = title;
|
Title = title;
|
||||||
RequestedDate = req?.RequestedDate.ToString("D");
|
RequestedDate = req?.RequestedDate.ToString("D");
|
||||||
|
if (Type.IsNullOrEmpty())
|
||||||
|
{
|
||||||
Type = req?.RequestType.ToString();
|
Type = req?.RequestType.ToString();
|
||||||
|
}
|
||||||
Overview = req?.Overview;
|
Overview = req?.Overview;
|
||||||
Year = req?.ReleaseDate.Year.ToString();
|
Year = req?.ReleaseDate.Year.ToString();
|
||||||
PosterImage = req?.RequestType == RequestType.Movie ?
|
PosterImage = req?.RequestType == RequestType.Movie ?
|
||||||
|
@ -65,11 +73,19 @@ namespace Ombi.Notifications
|
||||||
ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty;
|
ApplicationUrl = (s?.ApplicationUrl.HasValue() ?? false) ? s.ApplicationUrl : string.Empty;
|
||||||
ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName;
|
ApplicationName = string.IsNullOrEmpty(s?.ApplicationName) ? "Ombi" : s?.ApplicationName;
|
||||||
RequestedUser = req?.RequestedUser?.UserName;
|
RequestedUser = req?.RequestedUser?.UserName;
|
||||||
|
if (UserName.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
// Can be set if it's an issue
|
||||||
UserName = req?.RequestedUser?.UserName;
|
UserName = req?.RequestedUser?.UserName;
|
||||||
|
}
|
||||||
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
|
Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName;
|
||||||
Title = title;
|
Title = title;
|
||||||
RequestedDate = req?.RequestedDate.ToString("D");
|
RequestedDate = req?.RequestedDate.ToString("D");
|
||||||
|
if (Type.IsNullOrEmpty())
|
||||||
|
{
|
||||||
Type = req?.RequestType.ToString();
|
Type = req?.RequestType.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
Overview = req?.ParentRequest.Overview;
|
Overview = req?.ParentRequest.Overview;
|
||||||
Year = req?.ParentRequest.ReleaseDate.Year.ToString();
|
Year = req?.ParentRequest.ReleaseDate.Year.ToString();
|
||||||
PosterImage = req?.RequestType == RequestType.Movie ?
|
PosterImage = req?.RequestType == RequestType.Movie ?
|
||||||
|
@ -128,6 +144,7 @@ namespace Ombi.Notifications
|
||||||
IssueSubject = opts.Substitutes.TryGetValue("IssueSubject", out val) ? val : string.Empty;
|
IssueSubject = opts.Substitutes.TryGetValue("IssueSubject", out val) ? val : string.Empty;
|
||||||
NewIssueComment = opts.Substitutes.TryGetValue("NewIssueComment", out val) ? val : string.Empty;
|
NewIssueComment = opts.Substitutes.TryGetValue("NewIssueComment", out val) ? val : string.Empty;
|
||||||
UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty;
|
UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty;
|
||||||
|
Type = opts.Substitutes.TryGetValue("RequestType", out val) ? val : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
// User Defined
|
// User Defined
|
||||||
|
|
|
@ -283,6 +283,7 @@ namespace Ombi.Controllers
|
||||||
notificationModel.Substitutes.Add("IssueStatus", issue.Status.ToString());
|
notificationModel.Substitutes.Add("IssueStatus", issue.Status.ToString());
|
||||||
notificationModel.Substitutes.Add("IssueSubject", issue.Subject);
|
notificationModel.Substitutes.Add("IssueSubject", issue.Subject);
|
||||||
notificationModel.Substitutes.Add("IssueUser", issueReportedUsername);
|
notificationModel.Substitutes.Add("IssueUser", issueReportedUsername);
|
||||||
|
notificationModel.Substitutes.Add("RequestType", notificationModel.RequestType.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue