resuse the message queue for livestream downloading

This commit is contained in:
2024-08-23 18:52:13 +02:00
parent fceb36c723
commit 54771b2d78
6 changed files with 45 additions and 64 deletions

View File

@@ -36,17 +36,19 @@ const (
StatusDownloading
StatusCompleted
StatusErrored
StatusLivestream
)
// Process descriptor
type Process struct {
Id string
Url string
Params []string
Info DownloadInfo
Progress DownloadProgress
Output DownloadOutput
proc *os.Process
Id string
Url string
Livestream bool
Params []string
Info DownloadInfo
Progress DownloadProgress
Output DownloadOutput
proc *os.Process
}
// Starts spawns/forks a new yt-dlp process and parse its stdout.
@@ -166,6 +168,10 @@ func (p *Process) Start() {
ETA: progress.Eta,
}
if p.Livestream {
p.Progress.Status = StatusLivestream
}
slog.Info("progress",
slog.String("id", p.getShortId()),
slog.String("url", p.Url),