mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
Allow for the ability to set Pushover notification sound and priority from within Ombi.
This commit is contained in:
parent
94a1f3a00d
commit
c6bb864be7
7 changed files with 52 additions and 4 deletions
|
@ -5,6 +5,6 @@ namespace Ombi.Api.Pushover
|
|||
{
|
||||
public interface IPushoverApi
|
||||
{
|
||||
Task<PushoverResponse> PushAsync(string accessToken, string message, string userToken);
|
||||
Task<PushoverResponse> PushAsync(string accessToken, string message, string userToken, sbyte priority, string sound);
|
||||
}
|
||||
}
|
|
@ -16,13 +16,13 @@ namespace Ombi.Api.Pushover
|
|||
private readonly IApi _api;
|
||||
private const string PushoverEndpoint = "https://api.pushover.net/1";
|
||||
|
||||
public async Task<PushoverResponse> PushAsync(string accessToken, string message, string userToken)
|
||||
public async Task<PushoverResponse> PushAsync(string accessToken, string message, string userToken, sbyte priority, string sound)
|
||||
{
|
||||
if (message.Contains("'"))
|
||||
{
|
||||
message = message.Replace("'", "'");
|
||||
}
|
||||
var request = new Request($"messages.json?token={accessToken}&user={userToken}&message={WebUtility.HtmlEncode(message)}", PushoverEndpoint, HttpMethod.Post);
|
||||
var request = new Request($"messages.json?token={accessToken}&user={userToken}&priority={priority}&sound={sound}&message={WebUtility.HtmlEncode(message)}", PushoverEndpoint, HttpMethod.Post);
|
||||
|
||||
var result = await _api.Request<PushoverResponse>(request);
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue