From c58cb4dbe1eff9fdd075cecd9e484ab874d96641 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Wed, 18 Oct 2017 11:46:59 +0100 Subject: [PATCH] #1460 looks like the permissions issue has been resolved. Just need to make sure the Ombi process is terminated. Also fixed that we were not sending email notifications to users when something was available. --- src/Ombi.Notifications/Agents/EmailNotification.cs | 2 +- src/Ombi.Notifications/Models/NotificationOptions.cs | 1 + .../Jobs/Emby/EmbyAvaliabilityChecker.cs | 6 ++++-- .../Jobs/Plex/PlexAvailabilityChecker.cs | 6 ++++-- src/Ombi.Updater/Installer.cs | 12 ++++++++++-- .../app/settings/update/update.component.html | 4 ++-- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/Ombi.Notifications/Agents/EmailNotification.cs b/src/Ombi.Notifications/Agents/EmailNotification.cs index 29cce3ff1..9c8ed615f 100644 --- a/src/Ombi.Notifications/Agents/EmailNotification.cs +++ b/src/Ombi.Notifications/Agents/EmailNotification.cs @@ -57,7 +57,7 @@ namespace Ombi.Notifications.Agents { Message = html, Subject = parsed.Subject, - To = settings.AdminEmail, + To = model.Recipient.HasValue() ? model.Recipient : settings.AdminEmail, }; return message; diff --git a/src/Ombi.Notifications/Models/NotificationOptions.cs b/src/Ombi.Notifications/Models/NotificationOptions.cs index 92cc1fa51..bfcb4a85a 100644 --- a/src/Ombi.Notifications/Models/NotificationOptions.cs +++ b/src/Ombi.Notifications/Models/NotificationOptions.cs @@ -11,5 +11,6 @@ namespace Ombi.Notifications.Models public DateTime DateTime { get; set; } = DateTime.Now; public NotificationType NotificationType { get; set; } public RequestType RequestType { get; set; } + public string Recipient { get; set; } } } \ No newline at end of file diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyAvaliabilityChecker.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyAvaliabilityChecker.cs index ddc06b0b2..4ecc413e1 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyAvaliabilityChecker.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyAvaliabilityChecker.cs @@ -82,7 +82,8 @@ namespace Ombi.Schedule.Jobs.Emby DateTime = DateTime.Now, NotificationType = NotificationType.RequestAvailable, RequestId = movie.Id, - RequestType = RequestType.Movie + RequestType = RequestType.Movie, + Recipient = movie.RequestedUser.Email, })); } } @@ -130,7 +131,8 @@ namespace Ombi.Schedule.Jobs.Emby DateTime = DateTime.Now, NotificationType = NotificationType.RequestAvailable, RequestId = child.ParentRequestId, - RequestType = RequestType.TvShow + RequestType = RequestType.TvShow, + Recipient = child.RequestedUser.Email, })); } } diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexAvailabilityChecker.cs b/src/Ombi.Schedule/Jobs/Plex/PlexAvailabilityChecker.cs index e3578b25d..26e312af8 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexAvailabilityChecker.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexAvailabilityChecker.cs @@ -71,7 +71,8 @@ namespace Ombi.Schedule.Jobs.Plex DateTime = DateTime.Now, NotificationType = NotificationType.RequestAvailable, RequestId = child.ParentRequestId, - RequestType = RequestType.TvShow + RequestType = RequestType.TvShow, + Recipient = child.RequestedUser.Email })); } } @@ -101,7 +102,8 @@ namespace Ombi.Schedule.Jobs.Plex DateTime = DateTime.Now, NotificationType = NotificationType.RequestAvailable, RequestId = movie.Id, - RequestType = RequestType.Movie + RequestType = RequestType.Movie, + Recipient = movie.RequestedUser.Email })); } } diff --git a/src/Ombi.Updater/Installer.cs b/src/Ombi.Updater/Installer.cs index c86123eda..467a296fa 100644 --- a/src/Ombi.Updater/Installer.cs +++ b/src/Ombi.Updater/Installer.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using System.Threading; namespace Ombi.Updater { @@ -18,9 +19,16 @@ namespace Ombi.Updater // Make sure the process has been killed - if (p.FindProcessByName("Ombi").Any()) + while (p.FindProcessByName("Ombi").Any()) { - // throw + Console.WriteLine("Found another process called Ombi, KILLING!"); + var proc = p.FindProcessByName("Ombi").FirstOrDefault(); + if (proc != null) + { + Console.WriteLine($"[{proc.Id}] - {proc.Name} - Path: {proc.StartPath}"); + p.Kill(proc.Id); + } + Thread.Sleep(500); } MoveFiles(options); diff --git a/src/Ombi/ClientApp/app/settings/update/update.component.html b/src/Ombi/ClientApp/app/settings/update/update.component.html index f8715a0da..207139197 100644 --- a/src/Ombi/ClientApp/app/settings/update/update.component.html +++ b/src/Ombi/ClientApp/app/settings/update/update.component.html @@ -24,12 +24,12 @@ If you are getting any permissions issues, you can specify a user for the update process to run under.
- +
- +