2023-12-21 15:01:06 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2023-12-24 10:29:44 +01:00
|
|
|
"ewintr.nl/emdb/client"
|
2023-12-22 15:50:42 +01:00
|
|
|
"ewintr.nl/emdb/cmd/terminal-client/tui"
|
2023-12-21 15:01:06 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-12-24 11:03:32 +01:00
|
|
|
logger := tui.NewLogger()
|
2023-12-24 10:29:44 +01:00
|
|
|
tmdb, err := client.NewTMDB(os.Getenv("TMDB_API_KEY"))
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
emdb := client.NewEMDB("https://emdb.ewintr.nl", os.Getenv("EMDB_API_KEY"))
|
2023-12-23 18:43:38 +01:00
|
|
|
|
2023-12-24 11:03:32 +01:00
|
|
|
p, err := tui.New(emdb, tmdb, logger)
|
2023-12-22 15:50:42 +01:00
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2023-12-24 11:03:32 +01:00
|
|
|
logger.SetProgram(p)
|
2023-12-21 15:15:51 +01:00
|
|
|
if _, err := p.Run(); err != nil {
|
2023-12-23 12:08:58 +01:00
|
|
|
fmt.Println(err)
|
2023-12-21 15:15:51 +01:00
|
|
|
os.Exit(1)
|
2023-12-21 15:01:06 +01:00
|
|
|
}
|
|
|
|
}
|