Filter admin streams from view
This commit is contained in:
@@ -97,6 +97,17 @@ func formatViewerCount(count int) string {
|
|||||||
return fmt.Sprintf("%d", count)
|
return fmt.Sprintf("%d", count)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func filterStreams(streams []Stream) []Stream {
|
||||||
|
filtered := streams[:0]
|
||||||
|
for _, st := range streams {
|
||||||
|
if strings.EqualFold(st.Source, "admin") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
filtered = append(filtered, st)
|
||||||
|
}
|
||||||
|
return filtered
|
||||||
|
}
|
||||||
|
|
||||||
// ────────────────────────────────
|
// ────────────────────────────────
|
||||||
// MODEL
|
// MODEL
|
||||||
// ────────────────────────────────
|
// ────────────────────────────────
|
||||||
@@ -502,7 +513,7 @@ func (m Model) fetchStreamsForMatch(mt Match) tea.Cmd {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errorMsg(err)
|
return errorMsg(err)
|
||||||
}
|
}
|
||||||
return streamsLoadedMsg(streams)
|
return streamsLoadedMsg(filterStreams(streams))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user