Fix webhook destination description

This commit is contained in:
crobibero 2021-01-18 08:51:23 -07:00
parent 2c1361fe66
commit afdbd764f1
6 changed files with 10 additions and 10 deletions

View File

@ -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>

View File

@ -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");
}
}

View File

@ -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");
}
}
}

View File

@ -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");
}
}
}

View File

@ -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");
}
}
}

View File

@ -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");
}
}
}