/// <summary>
/// This method generates the cbz file from the images in the manga book.
/// </summary>
/// <param name="mangaBook"></param>
/// <param name="saveLocation">Location to save the manga book cbz file.</param>
public void Generate(MangaBook mangaBook, string saveLocation)
{
OperationStatus.StartedMangaBookFileCreation(mangaBook);
Collection<string> imageSaveLocationList = new Collection<string>();
mangaBook.SaveLocationPath = Path.Combine(saveLocation, mangaBook.FileName());
using (ZipFile zip = new ZipFile(mangaBook.SaveLocationPath))
{
SavePagesAsPhysicalFiles(mangaBook, saveLocation, imageSaveLocationList);
// Get all pages from save location and create cbz file.
zip.AddFiles(imageSaveLocationList);
zip.Save();
// Delete the temporary files.
foreach (string path in imageSaveLocationList)
{
File.Delete(path);
}
}
OperationStatus.CompletedMangaBookFileCreation(mangaBook);
}