|
|
|
@ -39,7 +39,12 @@ namespace Ombi.Notifications
|
|
|
|
|
Year = req?.ReleaseDate.Year.ToString();
|
|
|
|
|
Overview = req?.Overview;
|
|
|
|
|
AdditionalInformation = opts?.AdditionalInformation ?? string.Empty;
|
|
|
|
|
PosterImage = $"https://image.tmdb.org/t/p/w300/{req?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
|
|
|
|
|
|
|
|
|
var img = req?.PosterPath ?? string.Empty;
|
|
|
|
|
if (img.HasValue())
|
|
|
|
|
{
|
|
|
|
|
PosterImage = $"https://image.tmdb.org/t/p/w300/{req?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
|
|
|
|
}
|
|
|
|
|
CalculateRequestStatus(req);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -53,8 +58,12 @@ namespace Ombi.Notifications
|
|
|
|
|
Year = req?.ParentRequest?.ReleaseDate.Year.ToString();
|
|
|
|
|
Overview = req?.ParentRequest?.Overview;
|
|
|
|
|
AdditionalInformation = opts.AdditionalInformation;
|
|
|
|
|
PosterImage =
|
|
|
|
|
$"https://image.tmdb.org/t/p/w300/{req?.ParentRequest?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
|
|
|
|
var img = req?.ParentRequest?.PosterPath ?? string.Empty;
|
|
|
|
|
if (img.HasValue())
|
|
|
|
|
{
|
|
|
|
|
PosterImage =
|
|
|
|
|
$"https://image.tmdb.org/t/p/w300/{req?.ParentRequest?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Generate episode list.
|
|
|
|
|
StringBuilder epSb = new StringBuilder();
|
|
|
|
@ -94,16 +103,17 @@ namespace Ombi.Notifications
|
|
|
|
|
|
|
|
|
|
private void LoadIssues(NotificationOptions opts)
|
|
|
|
|
{
|
|
|
|
|
IssueDescription = opts.Substitutes.TryGetValue("IssueDescription", out string val) ? val : string.Empty;
|
|
|
|
|
IssueCategory = opts.Substitutes.TryGetValue("IssueCategory", out val) ? val : string.Empty;
|
|
|
|
|
IssueStatus = opts.Substitutes.TryGetValue("IssueStatus", 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;
|
|
|
|
|
UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty;
|
|
|
|
|
Alias = opts.Substitutes.TryGetValue("IssueUserAlias", out val) ? val : string.Empty;
|
|
|
|
|
Type = opts.Substitutes.TryGetValue("RequestType", out val) && Enum.TryParse(val, out RequestType type)
|
|
|
|
|
IssueDescription = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueDescription, out string val) ? val : string.Empty;
|
|
|
|
|
IssueCategory = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueCategory, out val) ? val : string.Empty;
|
|
|
|
|
IssueStatus = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueStatus, out val) ? val : string.Empty;
|
|
|
|
|
IssueSubject = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueSubject, out val) ? val : string.Empty;
|
|
|
|
|
NewIssueComment = opts.Substitutes.TryGetValue(NotificationSubstitues.NewIssueComment, out val) ? val : string.Empty;
|
|
|
|
|
UserName = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueUser, out val) ? val : string.Empty;
|
|
|
|
|
Alias = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueUserAlias, out val) ? val : string.Empty;
|
|
|
|
|
Type = opts.Substitutes.TryGetValue(NotificationSubstitues.RequestType, out val) && Enum.TryParse(val, out RequestType type)
|
|
|
|
|
? HumanizeReturnType(type)
|
|
|
|
|
: string.Empty;
|
|
|
|
|
PosterImage = opts.Substitutes.TryGetValue(NotificationSubstitues.PosterPath, out val) ? $"https://image.tmdb.org/t/p/w300/{val.TrimStart('/')}" : string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LoadCommon(BaseRequest req, CustomizationSettings s, UserNotificationPreferences pref, NotificationOptions opts)
|
|
|
|
|