mirror of
https://github.com/jellyfin/jellyfin-plugin-webhook.git
synced 2024-11-27 00:00:28 +00:00
Fix webhook destination description
This commit is contained in:
parent
2c1361fe66
commit
afdbd764f1
@ -48,7 +48,7 @@
|
||||
<template id="template-base">
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="text" data-name="txtWebhookUri" required="required" label="Webhook Url:"/>
|
||||
<span>For linking to content. Include base url.</span>
|
||||
<span>The webhook destination url</span>
|
||||
</div>
|
||||
<div>
|
||||
<label>Notification Type:</label>
|
||||
|
@ -48,7 +48,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Discord
|
||||
}
|
||||
|
||||
var body = options.GetCompiledTemplate()(data);
|
||||
_logger.LogDebug("SendAsync Body: {@body}", body);
|
||||
_logger.LogDebug("SendAsync Body: {@Body}", body);
|
||||
using var content = new StringContent(body, Encoding.UTF8, MediaTypeNames.Application.Json);
|
||||
using var response = await _httpClient.PostAsync(options.WebhookUri, content);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -59,7 +59,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Discord
|
||||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
_logger.LogWarning(e, "Error sending notification.");
|
||||
_logger.LogWarning(e, "Error sending notification");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Generic
|
||||
}
|
||||
|
||||
var body = options.GetCompiledTemplate()(data);
|
||||
_logger.LogDebug("SendAsync Body: {@body}", body);
|
||||
_logger.LogDebug("SendAsync Body: {@Body}", body);
|
||||
using var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, options.WebhookUri);
|
||||
var contentType = MediaTypeNames.Text.Plain;
|
||||
foreach (var header in options.Headers)
|
||||
@ -76,7 +76,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Generic
|
||||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
_logger.LogWarning(e, "Error sending notification.");
|
||||
_logger.LogWarning(e, "Error sending notification");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Gotify
|
||||
data["Priority"] = options.Priority;
|
||||
|
||||
var body = options.GetCompiledTemplate()(data);
|
||||
_logger.LogDebug("SendAsync Body: {@body}", body);
|
||||
_logger.LogDebug("SendAsync Body: {@Body}", body);
|
||||
using var content = new StringContent(body, Encoding.UTF8, MediaTypeNames.Application.Json);
|
||||
using var response = await _httpClient.PostAsync(options.WebhookUri.TrimEnd() + $"/message?token={options.Token}", content);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
@ -50,7 +50,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Gotify
|
||||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
_logger.LogWarning(e, "Error sending notification.");
|
||||
_logger.LogWarning(e, "Error sending notification");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Pushover
|
||||
}
|
||||
|
||||
var body = options.GetCompiledTemplate()(data);
|
||||
_logger.LogDebug("SendAsync Body: {body}", body);
|
||||
_logger.LogDebug("SendAsync Body: {@Body}", body);
|
||||
using var content = new StringContent(body, Encoding.UTF8, MediaTypeNames.Application.Json);
|
||||
using var response = await _httpClient
|
||||
.PostAsync(string.IsNullOrEmpty(options.WebhookUri) ? PushoverOption.ApiUrl : options.WebhookUri, content);
|
||||
@ -74,7 +74,7 @@ namespace Jellyfin.Plugin.Webhook.Destinations.Pushover
|
||||
}
|
||||
catch (HttpRequestException e)
|
||||
{
|
||||
_logger.LogWarning(e, "Error sending notification.");
|
||||
_logger.LogWarning(e, "Error sending notification");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ namespace Jellyfin.Plugin.Webhook
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError(e, "Unable to send notification.");
|
||||
_logger.LogError(e, "Unable to send notification");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user