TrangaSettings as static field in Tranga instead of Static class

This commit is contained in:
2025-07-03 17:30:58 +02:00
parent 6f5823596a
commit 681d56710a
12 changed files with 90 additions and 200 deletions

View File

@ -101,7 +101,7 @@ public abstract class BaseWorker : Identifiable
Log.Info($"Waiting for {MissingDependencies.Count()} Dependencies {this}:\n\t{string.Join("\n\t", MissingDependencies.Select(d => d.ToString()))}");
while (CancellationTokenSource.IsCancellationRequested == false && MissingDependencies.Any())
{
Thread.Sleep(TrangaSettings.workCycleTimeout);
Thread.Sleep(Tranga.Settings.WorkCycleTimeoutMs);
}
return [this];
}

View File

@ -96,7 +96,7 @@ public class DownloadChapterFromMangaconnectorWorker(Chapter chapter, IEnumerabl
private void ProcessImage(string imagePath)
{
if (!TrangaSettings.bwImages && TrangaSettings.compression == 100)
if (!Tranga.Settings.BlackWhiteImages && Tranga.Settings.ImageCompression == 100)
{
Log.Debug("No processing requested for image");
return;
@ -107,12 +107,12 @@ public class DownloadChapterFromMangaconnectorWorker(Chapter chapter, IEnumerabl
try
{
using Image image = Image.Load(imagePath);
if (TrangaSettings.bwImages)
if (Tranga.Settings.BlackWhiteImages)
image.Mutate(i => i.ApplyProcessor(new AdaptiveThresholdProcessor()));
File.Delete(imagePath);
image.SaveAsJpeg(imagePath, new JpegEncoder()
{
Quality = TrangaSettings.compression
Quality = Tranga.Settings.ImageCompression
});
}
catch (Exception e)