Add final return statement to _album_artwork()

This commit is contained in:
Travis Abendshien
2024-06-15 13:06:36 -07:00
parent cee42545f7
commit 127fed7aa9

View File

@@ -392,6 +392,7 @@ class ThumbRenderer(QObject):
def _album_artwork(self, filepath: Path, ext: str) -> Image.Image | None:
"""Gets an album cover from an audio file if one is present."""
image: Image.Image = None
try:
artwork = None
if ext in [".mp3"]:
@@ -410,7 +411,7 @@ class ThumbRenderer(QObject):
if mp4_covers:
artwork = Image.open(BytesIO(mp4_covers[0]))
if artwork:
return artwork
image = artwork
except (
mp4.MP4MetadataError,
mp4.MP4StreamInfoError,
@@ -419,6 +420,7 @@ class ThumbRenderer(QObject):
logging.error(
f"[ThumbRenderer]{ERROR}: Couldn't read album artwork for {filepath.name} ({type(e).__name__})"
)
return image
def _audio_waveform(
self, filepath: Path, ext: str, size: int