From 4c0b8961741a7dd0cf2aba81cdbcb74c1208a1ff Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 31 Jul 2024 17:34:31 -0700 Subject: [PATCH] Improve messaging for for Send Notifications setting in Emby / Jellyfin Closes #7042 --- src/NzbDrone.Core/Localization/Core/en.json | 4 ++-- .../MediaBrowser/MediaBrowserProxy.cs | 18 +++++++++++++++++- .../MediaBrowser/MediaBrowserSettings.cs | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index a36ccadec..8d7d90087 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -1325,8 +1325,8 @@ "NotificationsEmailSettingsUseEncryption": "Use Encryption", "NotificationsEmailSettingsUseEncryptionHelpText": "Whether to prefer using encryption if configured on the server, to always use encryption via SSL (Port 465 only) or StartTLS (any other port) or to never use encryption", "NotificationsEmbySettingsSendNotifications": "Send Notifications", - "NotificationsEmbySettingsSendNotificationsHelpText": "Have MediaBrowser send notifications to configured providers", - "NotificationsEmbySettingsUpdateLibraryHelpText": "Update Library on Import, Rename, or Delete?", + "NotificationsEmbySettingsSendNotificationsHelpText": "Have Emby send notifications to configured providers. Not supported on Jellyfin.", + "NotificationsEmbySettingsUpdateLibraryHelpText": "Update Library on Import, Rename, or Delete", "NotificationsGotifySettingIncludeSeriesPoster": "Include Series Poster", "NotificationsGotifySettingIncludeSeriesPosterHelpText": "Include series poster in message", "NotificationsGotifySettingsAppToken": "App Token", diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs index 3d074034b..db17d965e 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserProxy.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using NLog; using NzbDrone.Common.Http; using NzbDrone.Common.Serializer; @@ -24,6 +25,7 @@ namespace NzbDrone.Core.Notifications.Emby var path = "/Notifications/Admin"; var request = BuildRequest(path, settings); request.Headers.ContentType = "application/json"; + request.LogHttpError = false; request.SetContent(new { @@ -32,7 +34,21 @@ namespace NzbDrone.Core.Notifications.Emby ImageUrl = "https://raw.github.com/Sonarr/Sonarr/develop/Logo/64.png" }.ToJson()); - ProcessRequest(request, settings); + try + { + ProcessRequest(request, settings); + } + catch (HttpException e) + { + if (e.Response.StatusCode == HttpStatusCode.NotFound) + { + _logger.Warn("Unable to send notification to Emby. If you're using Jellyfin disable 'Send Notifications'"); + } + else + { + throw; + } + } } public HashSet GetPaths(MediaBrowserSettings settings, Series series) diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs index 369888ceb..bd15c140e 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserSettings.cs @@ -25,6 +25,7 @@ namespace NzbDrone.Core.Notifications.Emby public MediaBrowserSettings() { Port = 8096; + UpdateLibrary = true; } [FieldDefinition(0, Label = "Host")]