mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 00:02:37 +02:00
34 lines
816 B
Go
34 lines
816 B
Go
// Package epuboptions EPUBOptions for EPUB creation.
|
|
package epuboptions
|
|
|
|
import "fmt"
|
|
|
|
type EPUBOptions struct {
|
|
Input string
|
|
Output string
|
|
Title string
|
|
TitlePage int
|
|
Author string
|
|
LimitMb int
|
|
StripFirstDirectoryFromToc bool
|
|
Dry bool
|
|
DryVerbose bool
|
|
SortPathMode int
|
|
Quiet bool
|
|
Json bool
|
|
Workers int
|
|
Image Image
|
|
}
|
|
|
|
func (o EPUBOptions) WorkersRatio(pct int) (nbWorkers int) {
|
|
nbWorkers = o.Workers * pct / 100
|
|
if nbWorkers < 1 {
|
|
nbWorkers = 1
|
|
}
|
|
return
|
|
}
|
|
|
|
func (o EPUBOptions) ImgStorage() string {
|
|
return fmt.Sprintf("%s.tmp", o.Output)
|
|
}
|