diff --git a/src/app/components/SearchCSDbNG.tsx b/src/app/components/SearchCSDbNG.tsx index d3b3539..3f2cc31 100644 --- a/src/app/components/SearchCSDbNG.tsx +++ b/src/app/components/SearchCSDbNG.tsx @@ -175,11 +175,13 @@ export default function SearchCSDbNG({ config, setConfig, onClose }: SearchCSDbN if (release?.ScreenShot?.[0]) { setMountProgress(p => p && { ...p, phase: 'image' }); try { - const imgRes = await fetch(release.ScreenShot[0]); + let imgPath = release.ScreenShot[0]; + try { imgPath = new URL(imgPath).pathname; } catch { /* already a path */ } + const imgRes = await fetch(resolveLink(imgPath)); if (imgRes.ok) { const imgData = await imgRes.arrayBuffer(); const mainBase = fname.replace(/\.[^.]+$/, ''); - const imgExt = release.ScreenShot[0].split('.').pop()?.split('?')[0]?.toLowerCase() ?? 'png'; + const imgExt = imgPath.split('.').pop()?.split('?')[0]?.toLowerCase() ?? 'png'; await putFileContents(joinPath(DOWNLOAD_DIR, `${mainBase}.${imgExt}`), imgData); } } catch { /* non-fatal */ }