mirror of
https://github.com/C9Glax/tranga.git
synced 2025-10-11 13:19:48 +02:00
Add RefreshLibrariesWorker.cs
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using API.MangaDownloadClients;
|
||||
using API.Workers;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace API;
|
||||
@@ -54,6 +55,10 @@ public struct TrangaSettings()
|
||||
|
||||
public int MaxConcurrentWorkers { get; set; } = Math.Max(Environment.ProcessorCount, 4); // Minimum of 4 Tasks, maximum of 1 per Core
|
||||
|
||||
public LibraryRefreshSetting LibraryRefreshSetting { get; set; } = LibraryRefreshSetting.AfterMangaFinished;
|
||||
|
||||
public int RefreshLibraryWhileDownloadingEveryMinutes { get; set; } = 10;
|
||||
|
||||
public static TrangaSettings Load()
|
||||
{
|
||||
if (!File.Exists(SettingsFilePath))
|
||||
@@ -125,4 +130,16 @@ public struct TrangaSettings()
|
||||
this.MaxConcurrentWorkers = value;
|
||||
Save();
|
||||
}
|
||||
|
||||
public void SetLibraryRefreshSetting(LibraryRefreshSetting setting)
|
||||
{
|
||||
this.LibraryRefreshSetting = setting;
|
||||
Save();
|
||||
}
|
||||
|
||||
public void SetRefreshLibraryWhileDownloadingEveryMinutes(int value)
|
||||
{
|
||||
this.RefreshLibraryWhileDownloadingEveryMinutes = value;
|
||||
Save();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user