From cac1fe5ed498de62cd450e3a2a578de8c7fb4d20 Mon Sep 17 00:00:00 2001 From: sinofp Date: Fri, 30 Aug 2024 22:43:24 +0100 Subject: [PATCH] Default %S to 'Unknown Artist' When metadata is absent, the %S template variable does not have a default value set in the dictionary, which can cause a "KeyError: 'S'" error. While %A defaults to 'Unknown Artist' and %S might conventionally default to 'Artist, Unknown', defaulting %S to that is unnecessary, because manual tagging typically follows to assign the correct name. Therefore, I default %S to 'Unknown Artist', just like %A. Signed-off-by: sinofp --- whipper/common/program.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whipper/common/program.py b/whipper/common/program.py index 56c39d0..ac5da82 100644 --- a/whipper/common/program.py +++ b/whipper/common/program.py @@ -195,7 +195,7 @@ class Program: assert isinstance(outdir, str), "%r is not str" % outdir assert isinstance(template, str), "%r is not str" % template v = {} - v['A'] = 'Unknown Artist' + v['S'] = v['A'] = 'Unknown Artist' v['I'] = v['d'] = v['D'] = mbdiscid # fallback for title v['r'] = 'unknown' v['R'] = 'Unknown'