add description for the profile

This commit is contained in:
Celogeek 2022-12-27 14:47:16 +01:00
parent f8359e7915
commit d9a8575898
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A

11
main.go
View File

@ -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,