emdb/cmd/terminal-client/tui/movie.go

24 lines
320 B
Go
Raw Normal View History

2023-12-22 15:50:42 +01:00
package tui
import (
"fmt"
2023-12-23 12:08:58 +01:00
"ewintr.nl/emdb/model"
2023-12-22 15:50:42 +01:00
)
type Movie struct {
2023-12-23 12:08:58 +01:00
m model.Movie
2023-12-22 15:50:42 +01:00
}
func (m Movie) FilterValue() string {
return m.m.Title
}
func (m Movie) Title() string {
2023-12-22 16:31:40 +01:00
return fmt.Sprintf("%s (%d)", m.m.Title, m.m.Year)
2023-12-22 15:50:42 +01:00
}
func (m Movie) Description() string {
2023-12-22 16:31:40 +01:00
return fmt.Sprintf("%s", m.m.Summary)
2023-12-22 15:50:42 +01:00
}