livestream code refactoring

This commit is contained in:
2024-08-24 13:07:07 +02:00
parent 434efc79d8
commit d4feefd639
4 changed files with 12 additions and 17 deletions

View File

@@ -5,7 +5,6 @@ import (
"log/slog"
"os"
"path/filepath"
"time"
"github.com/marcopeocchi/yt-dlp-web-ui/server/config"
"github.com/marcopeocchi/yt-dlp-web-ui/server/internal"
@@ -63,11 +62,7 @@ func (m *Monitor) Status() LiveStreamStatus {
// continue
// }
status[k] = struct {
Status int
WaitTime time.Duration
LiveDate time.Time
}{
status[k] = Status{
Status: v.status,
WaitTime: v.waitTime,
LiveDate: v.liveDate,

View File

@@ -5,7 +5,7 @@ import "time"
type LiveStreamStatus = map[string]Status
type Status = struct {
Status int
WaitTime time.Duration
LiveDate time.Time
Status int `json:"status"`
WaitTime time.Duration `json:"waitTime"`
LiveDate time.Time `json:"liveDate"`
}