diff --git a/src/Ombi.Notifications/Agents/WhatsAppNotification.cs b/src/Ombi.Notifications/Agents/WhatsAppNotification.cs index ae41dc09e..0f0cd5d09 100644 --- a/src/Ombi.Notifications/Agents/WhatsAppNotification.cs +++ b/src/Ombi.Notifications/Agents/WhatsAppNotification.cs @@ -36,7 +36,9 @@ namespace Ombi.Notifications.Agents { return false; } - return !settings.WhatsAppSettings.AccountSid.IsNullOrEmpty() && !settings.WhatsAppSettings.AuthToken.IsNullOrEmpty() && !settings.WhatsAppSettings.From.IsNullOrEmpty(); + return (!settings.WhatsAppSettings?.AccountSid?.IsNullOrEmpty() ?? false) + && (!settings.WhatsAppSettings?.AuthToken?.IsNullOrEmpty() ?? false) + && (!settings.WhatsAppSettings?.From?.IsNullOrEmpty() ?? false); } protected override async Task NewRequest(NotificationOptions model, TwilioSettings settings) diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs b/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs index b001878ff..27e6e3daa 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexContentSync.cs @@ -78,13 +78,11 @@ namespace Ombi.Schedule.Jobs.Plex { return; } - await Notification.Clients.Clients(NotificationHub.AdminConnectionIds) - .SendAsync(NotificationHub.NotificationEvent, recentlyAddedSearch ? "Plex Recently Added Sync Started" : "Plex Content Sync Started"); + await NotifyClient(recentlyAddedSearch ? "Plex Recently Added Sync Started" : "Plex Content Sync Started"); if (!ValidateSettings(plexSettings)) { Logger.LogError("Plex Settings are not valid"); - await Notification.Clients.Clients(NotificationHub.AdminConnectionIds) - .SendAsync(NotificationHub.NotificationEvent, recentlyAddedSearch ? "Plex Recently Added Sync, Settings Not Valid" : "Plex Content, Settings Not Valid"); + await NotifyClient(recentlyAddedSearch ? "Plex Recently Added Sync, Settings Not Valid" : "Plex Content, Settings Not Valid"); return; } var processedContent = new ProcessedContent(); @@ -104,13 +102,13 @@ namespace Ombi.Schedule.Jobs.Plex } catch (Exception e) { - await Notification.Clients.Clients(NotificationHub.AdminConnectionIds) - .SendAsync(NotificationHub.NotificationEvent, recentlyAddedSearch ? "Plex Recently Added Sync Errored" : "Plex Content Sync Errored"); + await NotifyClient(recentlyAddedSearch ? "Plex Recently Added Sync Errored" : "Plex Content Sync Errored"); Logger.LogWarning(LoggingEvents.PlexContentCacher, e, "Exception thrown when attempting to cache the Plex Content"); } if (!recentlyAddedSearch) { + await NotifyClient("Plex Sync - Starting Episode Sync"); Logger.LogInformation("Starting EP Cacher"); await OmbiQuartz.TriggerJob(nameof(IPlexEpisodeSync), "Plex"); } @@ -124,6 +122,7 @@ namespace Ombi.Schedule.Jobs.Plex } else { + await NotifyClient("Plex Sync - Checking if any requests are now available"); Logger.LogInformation("Kicking off Plex Availability Checker"); await OmbiQuartz.TriggerJob(nameof(IPlexAvailabilityChecker), "Plex"); } @@ -141,10 +140,11 @@ namespace Ombi.Schedule.Jobs.Plex await OmbiQuartz.TriggerJob(nameof(IPlexAvailabilityChecker), "Plex"); } } - Logger.LogInformation("Finished Plex Content Cacher, with processed content: {0}, episodes: {1}. Recently Added Scan: {2}", processedContent?.Content?.Count() ?? 0, processedContent?.Episodes?.Count() ?? 0, recentlyAddedSearch); + var processedCont = processedContent?.Content?.Count() ?? 0; + var processedEp = processedContent?.Episodes?.Count() ?? 0; + Logger.LogInformation("Finished Plex Content Cacher, with processed content: {0}, episodes: {1}. Recently Added Scan: {2}", processedContent, processedEp, recentlyAddedSearch); - await Notification.Clients.Clients(NotificationHub.AdminConnectionIds) - .SendAsync(NotificationHub.NotificationEvent, recentlyAddedSearch ? "Plex Recently Added Sync Finished" : "Plex Content Sync Finished"); + await NotifyClient(recentlyAddedSearch ? $"Plex Recently Added Sync Finished, We processed {processedCont}, and {processedEp} Episodes" : "Plex Content Sync Finished"); } @@ -186,6 +186,7 @@ namespace Ombi.Schedule.Jobs.Plex var allContent = await GetAllContent(servers, recentlyAddedSearch); Logger.LogDebug("We found {0} items", allContent.Count); + // Let's now process this. var contentToAdd = new HashSet(); @@ -654,7 +655,11 @@ namespace Ombi.Schedule.Jobs.Plex return libs; } - + private async Task NotifyClient(string message) + { + await Notification.Clients.Clients(NotificationHub.AdminConnectionIds) + .SendAsync(NotificationHub.NotificationEvent, $"Plex Sync - {message}"); + } private static bool ValidateSettings(PlexSettings plex) { diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.html b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.html index 670db05c6..362077673 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.html +++ b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.html @@ -9,8 +9,9 @@ Enable
- Advanced + Advanced
+
@@ -82,16 +83,17 @@
- -
-
-
Do not search
+
+
+ + +
diff --git a/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.html b/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.html index ae75f212c..e18b42fd1 100644 --- a/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.html +++ b/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.html @@ -5,7 +5,7 @@
Advanced - +