Notification-Thread Implemented

This commit is contained in:
2024-12-16 21:02:55 +01:00
parent ebc30c85bf
commit c4fc2f436b
3 changed files with 84 additions and 8 deletions

View File

@ -1,5 +1,6 @@
using System.Runtime.InteropServices;
using API.MangaDownloadClients;
using API.Schema;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using static System.IO.UnixFileMode;
@ -33,6 +34,14 @@ public static class TrangaSettings
};
public static Dictionary<RequestType, int> requestLimits { get; set; } = DefaultRequestLimits;
public static TimeSpan NotificationUrgencyDelay(NotificationUrgency urgency) => urgency switch
{
NotificationUrgency.High => TimeSpan.Zero,
NotificationUrgency.Normal => TimeSpan.FromMinutes(5),
NotificationUrgency.Low => TimeSpan.FromMinutes(10),
_ => TimeSpan.FromHours(1)
};
public static void Load()
{
if(File.Exists(settingsFilePath))