🎉 Start project

This commit is contained in:
Dan Jones 2024-10-23 15:56:56 -05:00
commit c711ed6567
7 changed files with 119 additions and 0 deletions

26
convids/methods.go Normal file
View file

@ -0,0 +1,26 @@
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
}
}
}
}
}