Print warning if album art isn't named correctly
This commit is contained in:
parent
4d011c0d5d
commit
3bf2ad38c2
|
@ -72,7 +72,14 @@ class Transcoder:
|
||||||
def copy_album_art(in_dir: Path, out_dir: Path, file_whitelist: list = None):
|
def copy_album_art(in_dir: Path, out_dir: Path, file_whitelist: list = None):
|
||||||
if file_whitelist is None:
|
if file_whitelist is None:
|
||||||
file_whitelist = ['.jpg', '.jpeg', '.png']
|
file_whitelist = ['.jpg', '.jpeg', '.png']
|
||||||
|
art_file_name = "cover.jpg"
|
||||||
|
|
||||||
|
art_found = False
|
||||||
for file in in_dir.iterdir():
|
for file in in_dir.iterdir():
|
||||||
if file.is_file() and file.suffix.lower() in file_whitelist:
|
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)
|
shutil.copy(file, out_dir / file.name)
|
||||||
|
|
||||||
|
if not art_found:
|
||||||
|
print(f"Warning: {art_file_name} not found in {in_dir}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user