fix: resolve back step, audio labels, progress parsing, file size pre-check, and stale job cleanup
All checks were successful
CI / build (push) Successful in 36s
All checks were successful
CI / build (push) Successful in 36s
- Fix handleBackStep to redirect to download prompt when step state is nil (previously silent no-op after container selection cleared the state) - Improve formatLabel for audio-only entries without bitrate: use ID + extension instead of generic 'audio', fixing duplicate entries in format list - Add yt-dlp --progress-template for reliable JSON progress parsing across all sites (fixes 0.0% progress on sites like xnxx.com where [download] lines are absent); keep regex parser as fallback for older yt-dlp versions - Add file size pre-check in handleContainerSelection before download starts (previously checked only after download completed, wasting bandwidth) - Clear stale active jobs and step state on /start for a clean slate
This commit is contained in:
@@ -89,7 +89,8 @@ func TestFormatLabel(t *testing.T) {
|
||||
want string
|
||||
}{
|
||||
{domain.Format{IsAudioOnly: true, Bitrate: "128k"}, "128k"},
|
||||
{domain.Format{IsAudioOnly: true}, "audio"},
|
||||
{domain.Format{ID: "140", Extension: "m4a", IsAudioOnly: true}, "140 (m4a)"},
|
||||
{domain.Format{ID: "251", IsAudioOnly: true}, "251"},
|
||||
{domain.Format{Resolution: "1920x1080", Height: 1080}, "1920x1080"},
|
||||
{domain.Format{Height: 720}, "720p"},
|
||||
{domain.Format{ID: "137"}, "137"},
|
||||
|
||||
Reference in New Issue
Block a user