()
| 23 | } |
| 24 | |
| 25 | func (widget *twitchChannelsWidget) initialize() error { |
| 26 | widget. |
| 27 | withTitle("Twitch Channels"). |
| 28 | withTitleURL("https://www.twitch.tv/directory/following"). |
| 29 | withCacheDuration(time.Minute * 10) |
| 30 | |
| 31 | if widget.CollapseAfter == 0 || widget.CollapseAfter < -1 { |
| 32 | widget.CollapseAfter = 5 |
| 33 | } |
| 34 | |
| 35 | if widget.SortBy != "viewers" && widget.SortBy != "live" { |
| 36 | widget.SortBy = "viewers" |
| 37 | } |
| 38 | |
| 39 | return nil |
| 40 | } |
| 41 | |
| 42 | func (widget *twitchChannelsWidget) update(ctx context.Context) { |
| 43 | channels, err := fetchChannelsFromTwitch(widget.ChannelsRequest) |
nothing calls this directly
no test coverage detected