utils/convids/methods.go
2024-10-23 15:56:56 -05:00

26 lines
410 B
Go

package convids
import (
"fmt"
"iter"
"slices"
)
func (s Shows) All() iter.Seq[Show] {
return slices.Values(s)
}
func (d Data) AllShows(silent bool) iter.Seq[Show] {
return func(yield func(Show) bool) {
for _, show := range d.Config.Shows {
if !silent {
fmt.Println("\nChecking", show, "shows\n")
}
for s := range d.Shows[show].All() {
if !yield(s) {
return
}
}
}
}
}