Documentation
¶
Index ¶
- func ExtractChapter(ctx context.Context, filePath string, keepFilenames bool) (*manga.Chapter, error)
- func IsAlreadyConverted(ctx context.Context, filePath string) (converted bool, err error)
- func LoadChapter(filePath string) (*manga.Chapter, error)
- func WriteChapterToCBZ(chapter *manga.Chapter, outputFilePath string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractChapter ¶ added in v2.7.0
func ExtractChapter(ctx context.Context, filePath string, keepFilenames bool) (*manga.Chapter, error)
ExtractChapter extracts an archive (CBZ/CBR) to a temp directory on disk. Pages are streamed directly to files — no image data is held in memory. Returns a Chapter with PageFile entries pointing to extracted files.
When keepFilenames is true, each PageFile has its OriginalName set to the base filename of the entry inside the archive. Downstream code uses that name to preserve the original page identity in the output CBZ (with the extension swapped for format conversion). When false, OriginalName stays empty and the sequential %04d naming convention is used instead.
func IsAlreadyConverted ¶ added in v2.7.0
IsAlreadyConverted performs a fast check to see if the archive is already converted without extracting any image data. It reads only the zip comment and metadata files (converted.txt) to determine conversion status.
func LoadChapter ¶
LoadChapter extracts the chapter from a CBZ/CBR file to disk. It delegates to ExtractChapter with keepFilenames=false and always extracts all pages. Use IsAlreadyConverted for a fast conversion status check without extraction.
Types ¶
This section is empty.