Skip to content

Commit

Permalink
Added average score to list view, brighter text in list view
Browse files Browse the repository at this point in the history
  • Loading branch information
aQaTL committed Nov 12, 2018
1 parent b606360 commit 6d5481b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions search_cui.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func alSearch(ctx *cli.Context) error {
results[i].Description = descriptionReplacer.Replace(results[i].Description)
}

gui, err := gocui.NewGui(gocui.Output256)
gui, err := gocui.NewGui(gocui.OutputNormal)
defer gui.Close()
if err != nil {
return fmt.Errorf("gocui error: %v", err)
Expand Down Expand Up @@ -82,8 +82,8 @@ type searchCui struct {
}

var searchResultHighlight = color.New(color.FgBlack, color.BgYellow)
var yellowC = color.New(color.FgYellow)
var cyanC = color.New(color.FgCyan)
var yellowC = color.New(color.FgYellow, color.Bold)
var cyanC = color.New(color.FgCyan, color.Bold)

func (sc *searchCui) setGuiKeyBindings(gui *gocui.Gui) {
gui.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quitGocui)
Expand Down Expand Up @@ -127,14 +127,16 @@ func (sc *searchCui) listLayout() error {
} else {
yellowC.Fprintln(v, result.Title.UserPreferred)
}
cyanC.Fprint(v, strings.ToLower(fmt.Sprintf("%s | %s | %d eps | %s %d | %v\n",
result.Format,
result.Status,
result.Episodes,
result.Season,
result.StartDate.Year,
result.Genres,
)))
cyanC.Fprint(v, strings.ToLower(
fmt.Sprintf("%s | %s | %d eps | %s %d | %d%% | %v\n",
result.Format,
result.Status,
result.Episodes,
result.Season,
result.StartDate.Year,
result.AverageScore,
result.Genres,
)))
fmt.Fprintln(v, result.Description)

}
Expand Down

0 comments on commit 6d5481b

Please sign in to comment.