feat: add twitch live detection to streamer list

This commit is contained in:
2026-04-28 23:22:51 +02:00
parent 2f81173f1e
commit 01b044e305
7 changed files with 354 additions and 32 deletions
+7 -1
View File
@@ -14,6 +14,8 @@ import (
"parasocial/internal/twitch"
)
const liveDot = "\x1b[32m●\x1b[0m"
type viewMode int
const (
@@ -195,7 +197,11 @@ func (m Model) View() string {
for i, streamer := range m.streamers {
switch streamer.Status {
case twitch.StreamerReady:
fmt.Fprintf(&builder, "%d. %s (%s)\n", i+1, streamer.Login, streamer.ChannelID)
label := streamer.Login
if streamer.Live {
label += " " + liveDot
}
fmt.Fprintf(&builder, "%d. %s (%s)\n", i+1, label, streamer.ChannelID)
case twitch.StreamerError:
fmt.Fprintf(&builder, "%d. %s [error: %s]\n", i+1, streamer.ConfigLogin, streamer.Error)
default: