MCPcopy
hub / github.com/glanceapp/glance / initialize

Method initialize

internal/glance/widget-twitch-channels.go:25–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23}
24
25func (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
42func (widget *twitchChannelsWidget) update(ctx context.Context) {
43 channels, err := fetchChannelsFromTwitch(widget.ChannelsRequest)

Callers

nothing calls this directly

Calls 3

withCacheDurationMethod · 0.80
withTitleURLMethod · 0.80
withTitleMethod · 0.80

Tested by

no test coverage detected