From c89e312520a573486b88b437dfc51221607e6dc0 Mon Sep 17 00:00:00 2001 From: Johnny Shankman`` Date: Thu, 19 Dec 2024 22:18:01 -0500 Subject: [PATCH 1/2] Patch/Feature: Malformed album art not showing placeholder --- src/renderer/components/AlbumArt.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/AlbumArt.tsx b/src/renderer/components/AlbumArt.tsx index 6fe8582..6d656bb 100644 --- a/src/renderer/components/AlbumArt.tsx +++ b/src/renderer/components/AlbumArt.tsx @@ -38,6 +38,13 @@ export default function AlbumArt({ * @dev component state */ const [albumArtMaxWidth, setAlbumArtMaxWidth] = useState(320); + const [loadError, setLoadError] = useState(false); + + useEffect(() => { + if (currentSongDataURL) { + setLoadError(false); + } + }, [currentSongDataURL]); useEffect(() => { const handleResize = () => { @@ -60,7 +67,7 @@ export default function AlbumArt({ }; }, [width, height]); - if (!currentSongDataURL) { + if (!currentSongDataURL || loadError) { return (
{ + // @note: this is reset back to false when the image url is updated + setLoadError(true); + }} src={currentSongDataURL} style={{ maxWidth: `${albumArtMaxWidth}px`, From 9578b4af959dab5eb1c060719509dbb0d36a3200 Mon Sep 17 00:00:00 2001 From: Johnny Shankman`` Date: Thu, 19 Dec 2024 22:20:04 -0500 Subject: [PATCH 2/2] patch level bump --- release/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/app/package.json b/release/app/package.json index b127e83..a3cfcd7 100644 --- a/release/app/package.json +++ b/release/app/package.json @@ -1,6 +1,6 @@ { "name": "hihat", - "version": "1.1.0", + "version": "1.1.1", "description": "A minimalist offline music player for OSX audiophiles :: Based on iTunes circa 2002 :: by White Lights", "license": "MIT", "author": {