diff --git a/cmd/terminal-client/tui/command.go b/cmd/terminal-client/tui/command.go deleted file mode 100644 index 1453173..0000000 --- a/cmd/terminal-client/tui/command.go +++ /dev/null @@ -1,23 +0,0 @@ -package tui - -import ( - "fmt" - - "ewintr.nl/emdb/client" - tea "github.com/charmbracelet/bubbletea" -) - -func FetchMovieList(emdb *client.EMDB, logger *Logger) tea.Cmd { - return func() tea.Msg { - logger.Log("fetching emdb movies...") - ems, err := emdb.GetMovies() - if err != nil { - logger.Log(err.Error()) - } - - //m.list.SetItems(items) - logger.Log(fmt.Sprintf("found %d movies in in emdb", len(ems))) - - return Movies(ems) - } -} diff --git a/cmd/terminal-client/tui/tabemdb.go b/cmd/terminal-client/tui/tabemdb.go index 20d89f9..334c544 100644 --- a/cmd/terminal-client/tui/tabemdb.go +++ b/cmd/terminal-client/tui/tabemdb.go @@ -1,6 +1,8 @@ package tui import ( + "fmt" + "ewintr.nl/emdb/client" "github.com/charmbracelet/bubbles/list" tea "github.com/charmbracelet/bubbletea" @@ -59,3 +61,18 @@ func (m emdbTab) View() string { func (m *emdbTab) Log(s string) { m.logger.Log(s) } + +func FetchMovieList(emdb *client.EMDB, logger *Logger) tea.Cmd { + return func() tea.Msg { + logger.Log("fetching emdb movies...") + ems, err := emdb.GetMovies() + if err != nil { + logger.Log(err.Error()) + } + + //m.list.SetItems(items) + logger.Log(fmt.Sprintf("found %d movies in in emdb", len(ems))) + + return Movies(ems) + } +}