mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-31 23:29:10 +00:00
Add final return statement to _album_artwork()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user