mirror of https://github.com/Sonarr/Sonarr
Fixed: Show better error message when TV library isn't added to Plex server
This commit is contained in:
parent
90ce35abee
commit
c5d4948d2a
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Common.Http;
|
using NzbDrone.Common.Http;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Notifications.Plex
|
namespace NzbDrone.Core.Notifications.Plex
|
||||||
|
@ -110,15 +111,17 @@ namespace NzbDrone.Core.Notifications.Plex
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!GetSectionKeys(new PlexServerSettings
|
var sections = GetSectionKeys(new PlexServerSettings
|
||||||
{
|
{
|
||||||
Host = settings.Host,
|
Host = settings.Host,
|
||||||
Port = settings.Port,
|
Port = settings.Port,
|
||||||
Username = settings.Username,
|
Username = settings.Username,
|
||||||
Password = settings.Password
|
Password = settings.Password
|
||||||
}).Any())
|
});
|
||||||
|
|
||||||
|
if (sections.Empty())
|
||||||
{
|
{
|
||||||
throw new Exception("Unable to connect to Plex Server");
|
return new ValidationFailure("Host", "At least one TV library is required");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
Loading…
Reference in New Issue