|
|
@ -40,7 +40,7 @@ namespace Ombi.Controllers.External
|
|
|
|
IPushbulletNotification pushbullet, ISlackNotification slack, IPushoverNotification po, IMattermostNotification mm,
|
|
|
|
IPushbulletNotification pushbullet, ISlackNotification slack, IPushoverNotification po, IMattermostNotification mm,
|
|
|
|
IPlexApi plex, IEmbyApi emby, IRadarrApi radarr, ISonarrApi sonarr, ILogger<TesterController> log, IEmailProvider provider,
|
|
|
|
IPlexApi plex, IEmbyApi emby, IRadarrApi radarr, ISonarrApi sonarr, ILogger<TesterController> log, IEmailProvider provider,
|
|
|
|
ICouchPotatoApi cpApi, ITelegramNotification telegram, ISickRageApi srApi, INewsletterJob newsletter, IMobileNotification mobileNotification,
|
|
|
|
ICouchPotatoApi cpApi, ITelegramNotification telegram, ISickRageApi srApi, INewsletterJob newsletter, IMobileNotification mobileNotification,
|
|
|
|
ILidarrApi lidarrApi, IGotifyNotification gotifyNotification)
|
|
|
|
ILidarrApi lidarrApi, IGotifyNotification gotifyNotification, IWebhookNotification webhookNotification)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Service = service;
|
|
|
|
Service = service;
|
|
|
|
DiscordNotification = notification;
|
|
|
|
DiscordNotification = notification;
|
|
|
@ -62,6 +62,7 @@ namespace Ombi.Controllers.External
|
|
|
|
MobileNotification = mobileNotification;
|
|
|
|
MobileNotification = mobileNotification;
|
|
|
|
LidarrApi = lidarrApi;
|
|
|
|
LidarrApi = lidarrApi;
|
|
|
|
GotifyNotification = gotifyNotification;
|
|
|
|
GotifyNotification = gotifyNotification;
|
|
|
|
|
|
|
|
WebhookNotification = webhookNotification;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private INotificationService Service { get; }
|
|
|
|
private INotificationService Service { get; }
|
|
|
@ -71,6 +72,7 @@ namespace Ombi.Controllers.External
|
|
|
|
private ISlackNotification SlackNotification { get; }
|
|
|
|
private ISlackNotification SlackNotification { get; }
|
|
|
|
private IPushoverNotification PushoverNotification { get; }
|
|
|
|
private IPushoverNotification PushoverNotification { get; }
|
|
|
|
private IGotifyNotification GotifyNotification { get; }
|
|
|
|
private IGotifyNotification GotifyNotification { get; }
|
|
|
|
|
|
|
|
private IWebhookNotification WebhookNotification { get; }
|
|
|
|
private IMattermostNotification MattermostNotification { get; }
|
|
|
|
private IMattermostNotification MattermostNotification { get; }
|
|
|
|
private IPlexApi PlexApi { get; }
|
|
|
|
private IPlexApi PlexApi { get; }
|
|
|
|
private IRadarrApi RadarrApi { get; }
|
|
|
|
private IRadarrApi RadarrApi { get; }
|
|
|
@ -181,6 +183,30 @@ namespace Ombi.Controllers.External
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Sends a test message to configured webhook using the provided settings
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="settings">The settings.</param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpPost("webhook")]
|
|
|
|
|
|
|
|
public bool Webhook([FromBody] WebhookSettings settings)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
settings.Enabled = true;
|
|
|
|
|
|
|
|
WebhookNotification.NotifyAsync(
|
|
|
|
|
|
|
|
new NotificationOptions { NotificationType = NotificationType.Test, RequestId = -1 }, settings);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Log.LogError(LoggingEvents.Api, e, "Could not test your webhook");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Sends a test message to mattermost using the provided settings
|
|
|
|
/// Sends a test message to mattermost using the provided settings
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|