diff --git a/fly.toml b/fly.toml index 0521c8f..63df152 100644 --- a/fly.toml +++ b/fly.toml @@ -13,7 +13,7 @@ processes = [] PORT = "8080" ROOT_URL = "https://kable.ca" MUSIC_DOWNLOAD_PATH = "/data/music" - YTDLP_BIN = "/data/bin/yt-dlp" + YTDLP_EXECUTABLE = "/data/bin/yt-dlp" YTDLP_COOKIES_FILE = "/data/cookies.txt" [experimental] diff --git a/handlers/fun/music/page.go b/handlers/fun/music/page.go index caf1178..ef100ed 100644 --- a/handlers/fun/music/page.go +++ b/handlers/fun/music/page.go @@ -195,8 +195,6 @@ func slugify(title, uploader string) string { } func (s *service) runDownload(id, url string, userID int64) error { - fmt.Println("DEBUGX dzDG 0") - ctx := context.TODO() cmd := os.Getenv("YTDLP_EXECUTABLE") @@ -204,8 +202,6 @@ func (s *service) runDownload(id, url string, userID int64) error { return fmt.Errorf("YTDLP_EXECUTABLE not set") } - fmt.Println("DEBUGX QtjQ 1") - dl := ytdlp.New(). SetExecutable(cmd). FormatSort("res,ext:mp4:m4a"). @@ -224,7 +220,6 @@ func (s *service) runDownload(id, url string, userID int64) error { if err != nil { return err } - fmt.Println("DEBUGX XrvK 2") title := "" uploader := "" @@ -248,7 +243,6 @@ func (s *service) runDownload(id, url string, userID int64) error { Status: "done", }) - fmt.Println("DEBUGX dza7 4") return nil } @@ -268,7 +262,7 @@ func (s *service) musicPage(userID int64) g.Node { g.Attr("hx-post", "/fun/music/download"), g.Attr("hx-target", "#downloads"), g.Attr("hx-swap", "innerHTML"), - g.Attr("hx-on::after-request", "this.reset()"), + g.Attr("hx-on::config-request", "this.reset()"), h.Div( h.Style("display:flex; gap:0.5rem"), h.Input( @@ -355,7 +349,7 @@ func (s *service) downloadsList(userID int64) g.Node { func downloadingRow(id, url string) g.Node { return h.Div( - h.Class("nes-container"), + h.Class("nes-container ghost"), h.Style("margin-bottom:0.5rem"), g.Attr("hx-get", "/fun/music/status?id="+id), g.Attr("hx-trigger", "every 2s"), @@ -387,7 +381,7 @@ func trackRow(t api.MusicTrack) g.Node { uploader = "—" } return h.Div( - h.Class("nes-container"), + h.Class("nes-container ghost"), h.Style("margin-bottom:0.5rem"), h.Div( h.Style("display:flex; align-items:center; gap:0.75rem"),