diff --git a/src/musiksammlung/ripper.py b/src/musiksammlung/ripper.py index f8c5a7b..e1dadd0 100644 --- a/src/musiksammlung/ripper.py +++ b/src/musiksammlung/ripper.py @@ -296,37 +296,37 @@ def _rip_with_abcde( """ output_dir.mkdir(parents=True, exist_ok=True) + # Build output format string: "flac" or "flac:-8" (with quality options) + encoder_opts = audio_format.get_encoder_options(quality) + output_fmt = audio_format.get_abcde_format() + if encoder_opts: + output_fmt = f"{output_fmt}:{encoder_opts}" + # abcde options: # -a actions: cddb+read+encode+tag (no 'move' — we extract files ourselves) # -p: pad track numbers with zeros - # -o format: output format + # -o format[:options]: output format with optional encoder options # -d device: CD drive # -x: eject CD after ripping # -N: non-interactive (auto-select first CDDB match, no prompts) + actions = "cddb,read,encode,tag" if use_cddb else "read,encode" + cmd = [ "abcde", + "-a", actions, "-p", - "-o", audio_format.get_abcde_format(), + "-o", output_fmt, "-d", device, "-x", "-N", ] - if use_cddb: - cmd.extend(["-a", "cddb,read,encode,tag"]) - else: - cmd.extend(["-a", "read,encode"]) - if parallel_jobs > 1: cmd.extend(["-j", str(parallel_jobs)]) if use_pipes: cmd.append("-P") - encoder_opts = audio_format.get_encoder_options(quality) - if encoder_opts: - cmd[-2] = f"{audio_format.get_abcde_format()}:{encoder_opts}" - print(f"\n Command: {' '.join(cmd)}", flush=True) logger.info("Starting abcde: %s", " ".join(cmd))