mirror of
https://github.com/Xevion/glance.git
synced 2025-12-10 16:07:22 -06:00
Add custom sorting to the twitch channels widget
this allows the channels to be sorted as defined in the config while still keeping the live channels on the top. the wording could probably be improved, "custom" is too broad but i'm not sure what else to call it.
This commit is contained in:
@@ -44,6 +44,12 @@ func (channels TwitchChannels) SortByViewers() {
|
||||
})
|
||||
}
|
||||
|
||||
func (channels TwitchChannels) SortByLive() {
|
||||
sort.SliceStable(channels, func(i, j int) bool {
|
||||
return channels[i].IsLive && !channels[j].IsLive
|
||||
})
|
||||
}
|
||||
|
||||
type twitchOperationResponse struct {
|
||||
Data json.RawMessage
|
||||
Extensions struct {
|
||||
|
||||
Reference in New Issue
Block a user