mirror of
https://github.com/C9Glax/tranga.git
synced 2025-07-04 09:54:16 +02:00
ToString overrides
This commit is contained in:
@ -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}";
|
||||
}
|
@ -17,4 +17,6 @@ public class DownloadCoverFromMangaconnectorWorker(MangaConnectorId<Manga> mcId,
|
||||
DbContext.Sync();
|
||||
return [];
|
||||
}
|
||||
|
||||
public override string ToString() => $"{base.ToString()} {MangaConnectorId}";
|
||||
}
|
@ -28,4 +28,6 @@ public class RetrieveMangaChaptersFromMangaconnectorWorker(MangaConnectorId<Mang
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public override string ToString() => $"{base.ToString()} {MangaConnectorId}";
|
||||
}
|
@ -44,4 +44,6 @@ public class MoveFileOrFolderWorker(string toLocation, string fromLocation, IEnu
|
||||
{
|
||||
File.Move(from.FullName, toLocation);
|
||||
}
|
||||
|
||||
public override string ToString() => $"{base.ToString()} {FromLocation} {ToLocation}";
|
||||
}
|
@ -15,4 +15,6 @@ public class MoveMangaLibraryWorker(Manga manga, FileLibrary toLibrary, IService
|
||||
|
||||
return manga.Chapters.Select(c => new MoveFileOrFolderWorker(c.FullArchiveFilePath, oldPath[c])).ToArray<BaseWorker>();
|
||||
}
|
||||
|
||||
public override string ToString() => $"{base.ToString()} {manga} {toLibrary}";
|
||||
}
|
@ -16,4 +16,6 @@ public class UpdateChaptersDownloadedWorker(Manga manga, TimeSpan? interval = nu
|
||||
DbContext.Sync();
|
||||
return [];
|
||||
}
|
||||
|
||||
public override string ToString() => $"{base.ToString()} {manga}";
|
||||
}
|
Reference in New Issue
Block a user