Fix sorting bug in twitch channels widget

This commit is contained in:
Svilen Markov 2025-03-22 11:02:06 +00:00
parent d99944dcff
commit 5ab962634e

View File

@ -196,6 +196,10 @@ func fetchChannelFromTwitchTask(channel string) (twitchChannel, error) {
slog.Warn("Failed to parse Twitch stream started at", "error", err, "started_at", streamMetadata.UserOrNull.Stream.StartedAt)
}
}
} else {
// This prevents live channels with 0 viewers from being
// incorrectly sorted lower than offline channels
result.ViewersCount = -1
}
return result, nil