diff --git a/Ombi.Services/Notification/NotificationEngine.cs b/Ombi.Services/Notification/NotificationEngine.cs index 44caf75b1..3782a1bfb 100644 --- a/Ombi.Services/Notification/NotificationEngine.cs +++ b/Ombi.Services/Notification/NotificationEngine.cs @@ -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. diff --git a/Ombi.UI/Modules/RequestsModule.cs b/Ombi.UI/Modules/RequestsModule.cs index d707244c0..0bd6a3d04 100644 --- a/Ombi.UI/Modules/RequestsModule.cs +++ b/Ombi.UI/Modules/RequestsModule.cs @@ -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); diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index d1a0722b0..8759d0325 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -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); }