Add date separators in matches list

This commit is contained in:
Salastil
2025-11-23 00:46:20 -05:00
parent 5afa624af0
commit 49ac8c9e1b
2 changed files with 150 additions and 19 deletions
+12
View File
@@ -168,6 +168,18 @@ func New(debug bool) Model {
}
return fmt.Sprintf("%s %s (%s)", when, title, mt.Category)
})
m.matches.SetSeparator(func(prev, curr Match) (string, bool) {
currDay := time.UnixMilli(curr.Date).Local().Format("Jan 2")
prevDay := ""
if prev.Date != 0 {
prevDay = time.UnixMilli(prev.Date).Local().Format("Jan 2")
}
if prevDay == "" || prevDay != currDay {
return currDay, true
}
return "", false
})
m.streams = NewListColumn[Stream]("Streams", func(st Stream) string {
quality := "SD"
if st.HD {