comments and code refactoring

This commit is contained in:
2024-04-24 11:52:14 +02:00
parent 01c327d308
commit 00bacf5c41
7 changed files with 39 additions and 20 deletions

View File

@@ -2,6 +2,7 @@ package internal
import "time"
// Used to unmarshall yt-dlp progress
type ProgressTemplate struct {
Percentage string `json:"percentage"`
Speed float32 `json:"speed"`
@@ -9,6 +10,7 @@ type ProgressTemplate struct {
Eta float32 `json:"eta"`
}
// Defines where and how the download needs to be saved
type DownloadOutput struct {
Path string
Filename string
@@ -92,6 +94,7 @@ type SetCookiesRequest struct {
Cookies string `json:"cookies"`
}
// represents a user defined collection of yt-dlp arguments
type CustomTemplate struct {
Id string `json:"id"`
Name string `json:"name"`

View File

@@ -168,7 +168,7 @@ func (p *Process) Start() {
p.Logger.Info("progress",
slog.String("id", p.getShortId()),
slog.String("url", p.Url),
slog.String("percentege", progress.Percentage),
slog.String("percentage", progress.Percentage),
)
})
}()