From c5d4948d2ac631ebe446c272d6696f1a67183794 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 3 Jan 2015 23:25:11 -0800 Subject: [PATCH] Fixed: Show better error message when TV library isn't added to Plex server --- .../Notifications/Plex/PlexService.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexService.cs index 011a70963..81caa24d4 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using FluentValidation.Results; using NLog; +using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; namespace NzbDrone.Core.Notifications.Plex @@ -110,15 +111,17 @@ namespace NzbDrone.Core.Notifications.Plex { try { - if (!GetSectionKeys(new PlexServerSettings + var sections = GetSectionKeys(new PlexServerSettings + { + Host = settings.Host, + Port = settings.Port, + Username = settings.Username, + Password = settings.Password + }); + + if (sections.Empty()) { - Host = settings.Host, - Port = settings.Port, - Username = settings.Username, - Password = settings.Password - }).Any()) - { - throw new Exception("Unable to connect to Plex Server"); + return new ValidationFailure("Host", "At least one TV library is required"); } } catch (Exception ex)