remove commands file

This commit is contained in:
Erik Winter 2023-12-24 11:06:04 +01:00
parent aa1efab569
commit 79308b7ac2
2 changed files with 17 additions and 23 deletions

View File

@ -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)
}
}

View File

@ -1,6 +1,8 @@
package tui package tui
import ( import (
"fmt"
"ewintr.nl/emdb/client" "ewintr.nl/emdb/client"
"github.com/charmbracelet/bubbles/list" "github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea" tea "github.com/charmbracelet/bubbletea"
@ -59,3 +61,18 @@ func (m emdbTab) View() string {
func (m *emdbTab) Log(s string) { func (m *emdbTab) Log(s string) {
m.logger.Log(s) 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)
}
}