pull/914/head
Jamie.Rees 8 years ago
parent d6fa9f8af7
commit bda34c9d1b

@ -95,7 +95,7 @@ namespace Ombi.Services.Notification
if (user.Equals(adminUsername, StringComparison.CurrentCultureIgnoreCase))
{
Log.Info("This user is the Plex server owner");
await PublishUserNotification(userAccount.Username, userAccount.Email, model.Title, model.PosterPath, type);
await PublishUserNotification(userAccount.Username, userAccount.Email, model.Title, model.PosterPath, type, model.Type);
return;
}
@ -108,7 +108,7 @@ namespace Ombi.Services.Notification
}
Log.Info("Sending notification to: {0} at: {1}, for title: {2}", email.Username, email.Email, model.Title);
await PublishUserNotification(email.Username, email.Email, model.Title, model.PosterPath, type);
await PublishUserNotification(email.Username, email.Email, model.Title, model.PosterPath, type, model.Type);
}
}
}
@ -137,7 +137,7 @@ namespace Ombi.Services.Notification
if (user.Equals(adminUsername, StringComparison.CurrentCultureIgnoreCase))
{
Log.Info("This user is the Plex server owner");
await PublishUserNotification(userAccount.Username, userAccount.Email, model.Title, model.PosterPath, type);
await PublishUserNotification(userAccount.Username, userAccount.Email, model.Title, model.PosterPath, type, model.Type);
return;
}
@ -150,7 +150,7 @@ namespace Ombi.Services.Notification
}
Log.Info("Sending notification to: {0} at: {1}, for title: {2}", email.Username, email.Email, model.Title);
await PublishUserNotification(email.Username, email.Email, model.Title, model.PosterPath, type);
await PublishUserNotification(email.Username, email.Email, model.Title, model.PosterPath, type, model.Type);
}
}
catch (Exception e)
@ -159,7 +159,7 @@ namespace Ombi.Services.Notification
}
}
private async Task PublishUserNotification(string username, string email, string title, string img, NotificationType type)
private async Task PublishUserNotification(string username, string email, string title, string img, NotificationType type, RequestType requestType)
{
var notificationModel = new NotificationModel
{
@ -167,7 +167,7 @@ namespace Ombi.Services.Notification
UserEmail = email,
NotificationType = type,
Title = title,
ImgSrc = img
ImgSrc = requestType == RequestType.Movie ? $"https://image.tmdb.org/t/p/w300/{img}" : img
};
// Send the notification to the user.

@ -351,7 +351,8 @@ namespace Ombi.UI.Modules
NotificationType = NotificationType.Issue,
Title = originalRequest.Title,
DateTime = DateTime.Now,
Body = issue == IssueState.Other ? comment : issue.ToString().ToCamelCaseWords()
Body = issue == IssueState.Other ? comment : issue.ToString().ToCamelCaseWords(),
ImgSrc = originalRequest.Type == RequestType.Movie ? $"https://image.tmdb.org/t/p/w300/{originalRequest.PosterPath}" : originalRequest.PosterPath
};
await NotificationService.Publish(model);

@ -1277,7 +1277,8 @@ namespace Ombi.UI.Modules
User = Username,
DateTime = DateTime.Now,
NotificationType = NotificationType.NewRequest,
RequestType = model.Type
RequestType = model.Type,
ImgSrc = model.Type == RequestType.Movie ? $"https://image.tmdb.org/t/p/w300/{model.PosterPath}" : model.PosterPath
};
await NotificationService.Publish(notificationModel);
}
@ -1315,7 +1316,8 @@ namespace Ombi.UI.Modules
User = Username,
DateTime = DateTime.Now,
NotificationType = NotificationType.NewRequest,
RequestType = model.Type
RequestType = model.Type,
ImgSrc = model.Type == RequestType.Movie ? $"https://image.tmdb.org/t/p/w300/{model.PosterPath}" : model.PosterPath
};
await NotificationService.Publish(notificationModel);
}

Loading…
Cancel
Save