From b91511286c65c476d800251b3b07081934fcf7b1 Mon Sep 17 00:00:00 2001 From: Cuan Date: Wed, 20 Apr 2022 00:48:58 -0400 Subject: [PATCH] Added option to stop the program if ReplayGain data cannot be found --- bin/flac2pod | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/flac2pod b/bin/flac2pod index f7458d1..21f3f15 100755 --- a/bin/flac2pod +++ b/bin/flac2pod @@ -98,7 +98,9 @@ def scan_destination_convert(): if _rggain is not None: print(f"\u001b[38;5;0;48;5;15mGain adjustment: {_rggain}dB\u001b[0m") else: - print(f"\u001b[38;5;0;48;5;15mNo ReplayGain data found!\u001b[0m") + print(f"\u001b[38;5;0;48;5;88mNo ReplayGain data found!\u001b[0m") + if args.stopifnogain: + s_exit() Popen(_cmd, shell=True) _active_processes = int(check_output('ps -C ffmpeg | wc -l', shell=True)) - 1 while _active_processes != 0: @@ -120,8 +122,10 @@ if __name__ == "__main__": help='destination parent directory for output - will be created if it does not already exist') parser.add_argument('-b', '--bake', action='store_true', help='bake (encode) ReplayGain values into the file') - parser.add_argument('--albumgain', action='store_true', + parser.add_argument('-a', '--albumgain', action='store_true', help='read ReplayGain album gain instead of ReplayGain track gain') + parser.add_argument('-x', '--stopifnogain', action='store_true', + help='stop flac2pod if ReplayGain data cannot be found in a file') args = parser.parse_args() if args.source_dir[0].endswith('/'):