mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 15:52:38 +02:00
add description for the profile
This commit is contained in:
parent
f8359e7915
commit
d9a8575898
11
main.go
11
main.go
@ -9,12 +9,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Profile struct {
|
type Profile struct {
|
||||||
|
Description string
|
||||||
Width int
|
Width int
|
||||||
Height int
|
Height int
|
||||||
}
|
}
|
||||||
|
|
||||||
var Profiles = map[string]Profile{
|
var Profiles = map[string]Profile{
|
||||||
"KS": {1860, 2480},
|
"KS": {"Kindle Scribe", 1860, 2480},
|
||||||
}
|
}
|
||||||
|
|
||||||
type Option struct {
|
type Option struct {
|
||||||
@ -27,9 +28,10 @@ type Option struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Option) String() string {
|
func (o *Option) String() string {
|
||||||
|
var desc string
|
||||||
var width, height int
|
var width, height int
|
||||||
profile, profileMatch := Profiles[o.Profile]
|
if profile, ok := Profiles[o.Profile]; ok {
|
||||||
if profileMatch {
|
desc = profile.Description
|
||||||
width = profile.Width
|
width = profile.Width
|
||||||
height = profile.Height
|
height = profile.Height
|
||||||
}
|
}
|
||||||
@ -37,7 +39,7 @@ func (o *Option) String() string {
|
|||||||
return fmt.Sprintf(`Options:
|
return fmt.Sprintf(`Options:
|
||||||
Input : %s
|
Input : %s
|
||||||
Output : %s
|
Output : %s
|
||||||
Profile: %s (%dx%d)
|
Profile: %s - %s - %dx%d
|
||||||
Author : %s
|
Author : %s
|
||||||
Title : %s
|
Title : %s
|
||||||
Quality: %d
|
Quality: %d
|
||||||
@ -45,6 +47,7 @@ func (o *Option) String() string {
|
|||||||
o.Input,
|
o.Input,
|
||||||
o.Output,
|
o.Output,
|
||||||
o.Profile,
|
o.Profile,
|
||||||
|
desc,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
o.Author,
|
o.Author,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user