Print warning if album art isn't named correctly

This commit is contained in:
George Lacey 2025-01-18 13:40:27 +00:00
parent 4d011c0d5d
commit 3bf2ad38c2

View File

@ -72,7 +72,14 @@ class Transcoder:
def copy_album_art(in_dir: Path, out_dir: Path, file_whitelist: list = None):
if file_whitelist is None:
file_whitelist = ['.jpg', '.jpeg', '.png']
art_file_name = "cover.jpg"
art_found = False
for file in in_dir.iterdir():
if file.is_file() and file.suffix.lower() in file_whitelist:
if file.name == art_file_name:
art_found = True
shutil.copy(file, out_dir / file.name)
if not art_found:
print(f"Warning: {art_file_name} not found in {in_dir}")