26 lines
410 B
Go
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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|