mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02: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:
@@ -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.PushBullet
|
||||
{
|
||||
public class PushBullet : NotificationBase<PushBulletSettings>
|
||||
{
|
||||
private readonly IPushBulletProxy _pushBulletProxy;
|
||||
private readonly IPushBulletProxy _proxy;
|
||||
|
||||
public PushBullet(IPushBulletProxy pushBulletProxy)
|
||||
public PushBullet(IPushBulletProxy proxy)
|
||||
{
|
||||
_pushBulletProxy = pushBulletProxy;
|
||||
_proxy = proxy;
|
||||
}
|
||||
|
||||
public override string Link
|
||||
@@ -20,18 +23,27 @@ namespace NzbDrone.Core.Notifications.PushBullet
|
||||
{
|
||||
const string title = "Episode Grabbed";
|
||||
|
||||
_pushBulletProxy.SendNotification(title, message, Settings.ApiKey, Settings.DeviceId);
|
||||
_proxy.SendNotification(title, message, Settings.ApiKey, Settings.DeviceId);
|
||||
}
|
||||
|
||||
public override void OnDownload(DownloadMessage message)
|
||||
{
|
||||
const string title = "Episode Downloaded";
|
||||
|
||||
_pushBulletProxy.SendNotification(title, message.Message, Settings.ApiKey, Settings.DeviceId);
|
||||
_proxy.SendNotification(title, message.Message, Settings.ApiKey, Settings.DeviceId);
|
||||
}
|
||||
|
||||
public override void AfterRename(Series series)
|
||||
{
|
||||
}
|
||||
|
||||
public override ValidationResult Test()
|
||||
{
|
||||
var failures = new List<ValidationFailure>();
|
||||
|
||||
failures.AddIfNotNull(_proxy.Test(Settings));
|
||||
|
||||
return new ValidationResult(failures);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user