feat(cli): add --strict flag to fail track download if quality is unavailable

This commit is contained in:
Mathis Maquenne
2025-08-09 19:17:29 +02:00
parent 7154c15cc3
commit 283c5d76e9
3 changed files with 15 additions and 4 deletions
+2 -1
View File
@@ -29,6 +29,7 @@ func init() {
downloadCmd.PersistentFlags().StringVarP(&opts.Quality, "quality", "q", "flac", "download quality [mp3_128, mp3_320, flac]")
downloadCmd.PersistentFlags().DurationVarP(&opts.Timeout, "timeout", "t", 2*time.Minute, "timeout for each download (e.g. 10s, 1m, 2m30s)")
downloadCmd.PersistentFlags().BoolVar(&opts.BPM, "bpm", false, "fetch BPM/key and add to file tags")
downloadCmd.PersistentFlags().BoolVar(&opts.Strict, "strict", false, "fail the song download if the quality is not available")
downloadCmd.AddCommand(
newDownloadCmd("album"),
@@ -78,7 +79,7 @@ func newDownloadCmd(resourceType string) *cobra.Command {
if resourceType == "artist" {
cmd.Flags().IntVarP(&opts.Limit, "limit", "l", 10, "number of songs to download")
cmd.Short = fmt.Sprintf("Download top songs from an artist")
cmd.Short = "Download top songs from an artist"
}
return cmd