DownloadSingleChapter narrow down FileStream options

This commit is contained in:
Glax 2025-03-07 13:38:32 +01:00
parent d314559361
commit 894f105786

View File

@ -78,7 +78,6 @@ public class DownloadSingleChapterJob(string chapterId, string? parentJobId = nu
{ {
if (!TrangaSettings.bwImages && TrangaSettings.compression == 100) if (!TrangaSettings.bwImages && TrangaSettings.compression == 100)
return; return;
DateTime start = DateTime.UtcNow;
using Image image = Image.Load(imagePath); using Image image = Image.Load(imagePath);
File.Delete(imagePath); File.Delete(imagePath);
if(TrangaSettings.bwImages) if(TrangaSettings.bwImages)
@ -127,7 +126,7 @@ public class DownloadSingleChapterJob(string chapterId, string? parentJobId = nu
if (requestResult.result == Stream.Null) if (requestResult.result == Stream.Null)
return false; return false;
FileStream fs = new (savePath, FileMode.Create); FileStream fs = new (savePath, FileMode.Create, FileAccess.Write, FileShare.None);
requestResult.result.CopyTo(fs); requestResult.result.CopyTo(fs);
fs.Close(); fs.Close();
ProcessImage(savePath); ProcessImage(savePath);