feat: add --stop-on-fail flag

This commit is contained in:
2026-02-28 16:34:53 +01:00
parent fcae48753b
commit 420429112a
3 changed files with 12 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ type App struct {
SpotifyClient *SpotifyClient
ApiInterval int // How many ms to wait between one call to apis and the other
NoFallback bool
StopOnFail bool
}
func NewApp() App {

View File

@@ -100,7 +100,11 @@ func (app *App) DownloadPlaylist(url string, outputFile string, service string,
fmt.Println("[" + strconv.Itoa(idx+1) + "/" + strconv.Itoa(trackListSize) + "] " + metadata.Data.TrackUnion.Name + " - " + artists)
if err := app.DownloadTrack(url, outputFile+"/", service, quality, true, metadata); err != nil {
return err
if app.StopOnFail {
return err
}
app.log("Failed download")
}
// Avoid getting rate limited