using System; using System.Collections.Generic; using System.IO.Compression; using System.Threading.Tasks; using Kavita.Common; using Kavita.Models.DTOs.Archive; using Kavita.Models.Entities.Enums; using Kavita.Models.Metadata; namespace Kavita.API.Services; public interface IArchiveService { void ExtractArchive(string archivePath, string extractPath); int GetNumberOfPagesFromArchive(string archivePath); string GetCoverImage(string archivePath, string fileName, string outputDirectory, EncodeFormat format, CoverImageSize size = CoverImageSize.Default); bool IsValidArchive(string archivePath); ComicInfo? GetComicInfo(string archivePath); ArchiveLibrary CanOpen(string archivePath); bool ArchiveNeedsFlattening(ZipArchive archive); /// /// Creates a zip file form the listed files and outputs to the temp folder. This will combine into one zip of multiple zips. /// /// List of files to be zipped up. Should be full file paths. /// Temp folder name to use for preparing the files. Will be created and deleted /// Path to the temp zip /// string CreateZipForDownload(IEnumerable files, string tempFolder); /// /// Creates a zip file form the listed files and outputs to the temp folder. This will extract each archive and combine them into one zip. /// /// List of files to be zipped up. Should be full file paths. /// Temp folder name to use for preparing the files. Will be created and deleted /// /// Path to the temp zip /// string CreateZipFromFoldersForDownload(IList files, string tempFolder, Func, Task> progressCallback); }