Crunchy-Downloader/CRD/Utils/Notifications/NotificationProviderConfig.cs
Elwador ff3e28093e - Added notification service for webhooks
- Added retry delay for rate limit handling
- Added toggle to control whether auto refresh also adds missing episodes to the queue
- Added configurable delay after each dub download
- Changed encoding preset dialog to show a preview of the FFmpeg command
- Changed play sound on queue empty and execute file on completion to be handled by the notification service
- Changed shutdown PC option to disable once triggered
- Fixed crash with queue persistence
- Fixed crash with audio player
- Fixed subscription countdown on the account page
2026-05-14 21:49:57 +02:00

37 lines
1 KiB
C#

using System.Collections.Generic;
using Newtonsoft.Json;
namespace CRD.Utils.Notifications;
public class NotificationProviderConfig{
[JsonProperty("type")]
public NotificationProviderType Type{ get; set; }
[JsonProperty("enabled")]
public bool Enabled{ get; set; }
[JsonProperty("events")]
public List<NotificationEventType> Events{ get; set; } = [];
[JsonProperty("path")]
public string Path{ get; set; } = string.Empty;
[JsonProperty("url")]
public string Url{ get; set; } = string.Empty;
[JsonProperty("method")]
public string Method{ get; set; } = "POST";
[JsonProperty("headers")]
public Dictionary<string, string> Headers{ get; set; } = [];
[JsonProperty("content_type")]
public string ContentType{ get; set; } = "application/json";
[JsonProperty("body_template")]
public string BodyTemplate{ get; set; } = string.Empty;
public bool Handles(NotificationEventType eventType){
return Events.Count == 0 || Events.Contains(eventType);
}
}