aboutsummaryrefslogtreecommitdiff
path: root/src/page_config.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/page_config.go')
-rw-r--r--src/page_config.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/page_config.go b/src/page_config.go
index 71662ec..2f8a27b 100644
--- a/src/page_config.go
+++ b/src/page_config.go
@@ -5,6 +5,7 @@ import (
5 "net/http" 5 "net/http"
6 6
7 "github.com/delucks/go-subsonic" 7 "github.com/delucks/go-subsonic"
8 "github.com/gdamore/tcell/v2"
8 "github.com/rivo/tview" 9 "github.com/rivo/tview"
9) 10)
10 11
@@ -36,6 +37,25 @@ func (a *app) configPage() *tview.Form {
36 a.alert("All good!") 37 a.alert("All good!")
37 } 38 }
38 }) 39 })
40
41 form.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
42 if event.Rune() == 'R' {
43 if err := a.refreshArtists(); err != nil {
44 a.alert("Error: %v", err)
45 return nil
46 }
47
48 if err := a.refreshPlaylists(); err != nil {
49 a.alert("Error: %v", err)
50 return nil
51 }
52
53 a.alert("Refreshed successfully")
54 }
55
56 return nil
57 })
58
39 return form 59 return form
40} 60}
41 61