1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

Provider testing improvements

New: Test button for indexers in UI

Fixed: Testing download clients shows error messages in UI
Fixed: Testing notifications shows error messages in UI
This commit is contained in:
Mark McDowall
2014-07-04 01:09:48 -07:00
parent c5bd8b27fb
commit 7af782d353
70 changed files with 727 additions and 591 deletions
@@ -1,14 +1,17 @@
using NzbDrone.Core.Tv;
using System.Collections.Generic;
using FluentValidation.Results;
using NzbDrone.Common;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Notifications.Plex
{
public class PlexClient : NotificationBase<PlexClientSettings>
{
private readonly IPlexService _plexProvider;
private readonly IPlexService _plexService;
public PlexClient(IPlexService plexProvider)
public PlexClient(IPlexService plexService)
{
_plexProvider = plexProvider;
_plexService = plexService;
}
public override string Link
@@ -19,17 +22,26 @@ namespace NzbDrone.Core.Notifications.Plex
public override void OnGrab(string message)
{
const string header = "NzbDrone [TV] - Grabbed";
_plexProvider.Notify(Settings, header, message);
_plexService.Notify(Settings, header, message);
}
public override void OnDownload(DownloadMessage message)
{
const string header = "NzbDrone [TV] - Downloaded";
_plexProvider.Notify(Settings, header, message.Message);
_plexService.Notify(Settings, header, message.Message);
}
public override void AfterRename(Series series)
{
}
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();
failures.AddIfNotNull(_plexService.Test(Settings));
return new ValidationResult(failures);
}
}
}