From 0301d304c1351208ad17acff0c92b73d84b7d4f8 Mon Sep 17 00:00:00 2001 From: Joey Ballentine Date: Wed, 20 Nov 2024 23:01:18 -0600 Subject: [PATCH] Fix flac scanning when no picture metadata present --- spotdl/utils/metadata.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spotdl/utils/metadata.py b/spotdl/utils/metadata.py index 9f9923ca9..15cd59475 100644 --- a/spotdl/utils/metadata.py +++ b/spotdl/utils/metadata.py @@ -445,7 +445,8 @@ def get_file_metadata(path: Path, id3_separator: str = "/") -> Optional[Dict[str continue if path.suffix == ".flac": - song_meta["album_art"] = audio_file.pictures[0].data + if len(audio_file.pictures) > 0: + song_meta["album_art"] = audio_file.pictures[0].data continue if path.suffix in [".ogg", ".opus"]: