When replacing filename pattern strings only log the ones we're seeing in config file
This commit is contained in:
parent
ec612de2dd
commit
029d9ffb7e
16
mvw-dl.py
16
mvw-dl.py
@ -374,13 +374,17 @@ def filename_replace_pattern(
|
|||||||
show_attrs = [attr for attr in dir(show) if not attr.startswith('_') and not callable(getattr(show, attr))]
|
show_attrs = [attr for attr in dir(show) if not attr.startswith('_') and not callable(getattr(show, attr))]
|
||||||
|
|
||||||
for attr in show_attrs:
|
for attr in show_attrs:
|
||||||
# log.debug(f"{shorthand_uuid} Replacing filename pattern '&({attr})s' ...")
|
attr_re = re.compile(r"&\(" + re.escape(attr) + r"\)s")
|
||||||
filename = re.sub(r"&\(" + re.escape(attr) + r"\)s", str(getattr(show, attr)), filename)
|
if re.search(attr_re, filename):
|
||||||
# log.debug(f"{shorthand_uuid} New filename: '{filename}'")
|
log.debug(f"{shorthand_uuid} Replacing filename pattern '&({attr})s' ...")
|
||||||
|
filename = re.sub(attr_re, str(getattr(show, attr)), filename)
|
||||||
|
log.debug(f"{shorthand_uuid} New filename: '{filename}'")
|
||||||
for extended_attr in show_extended:
|
for extended_attr in show_extended:
|
||||||
# log.debug(f"{shorthand_uuid} Replacing filename pattern '&({extended_attr})s' ...")
|
extended_attr_re = re.compile(r"&\(" + re.escape(extended_attr) + r"\)s")
|
||||||
filename = re.sub(r"&\(" + re.escape(extended_attr) + r"\)s", show_extended[extended_attr], filename)
|
if re.search(extended_attr_re, filename):
|
||||||
# log.debug(f"{shorthand_uuid} New filename: '{filename}'")
|
log.debug(f"{shorthand_uuid} Replacing filename pattern '&({extended_attr})s' ...")
|
||||||
|
filename = re.sub(extended_attr_re, show_extended[extended_attr], filename)
|
||||||
|
log.debug(f"{shorthand_uuid} New filename: '{filename}'")
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user