ToString overrides

This commit is contained in:
2025-07-03 20:38:18 +02:00
parent d6f0630a99
commit f05f2cc8e0
10 changed files with 21 additions and 8 deletions

View File

@ -161,21 +161,23 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId<Chapter> c
File.SetUnixFileMode(newFilePath, GroupRead | GroupWrite | UserRead | UserWrite | OtherRead | OtherWrite);
Log.Debug($"Copied cover from {fileInCache} to {newFilePath}");
}
private bool DownloadImage(string imageUrl, string savePath)
{
HttpDownloadClient downloadClient = new();
RequestResult requestResult = downloadClient.MakeRequest(imageUrl, RequestType.MangaImage);
if ((int)requestResult.statusCode < 200 || (int)requestResult.statusCode >= 300)
return false;
if (requestResult.result == Stream.Null)
return false;
FileStream fs = new (savePath, FileMode.Create, FileAccess.Write, FileShare.None);
FileStream fs = new(savePath, FileMode.Create, FileAccess.Write, FileShare.None);
requestResult.result.CopyTo(fs);
fs.Close();
ProcessImage(savePath);
return true;
}
public override string ToString() => $"{base.ToString()} {MangaConnectorId}";
}

View File

@ -17,4 +17,6 @@ public class DownloadCoverFromMangaconnectorWorker(MangaConnectorId<Manga> mcId,
DbContext.Sync();
return [];
}
public override string ToString() => $"{base.ToString()} {MangaConnectorId}";
}

View File

@ -28,4 +28,6 @@ public class RetrieveMangaChaptersFromMangaconnectorWorker(MangaConnectorId<Mang
return [];
}
public override string ToString() => $"{base.ToString()} {MangaConnectorId}";
}