Skip to content

Commit 4118648

Browse files
committed
fix(galgame): resolve gallery screenshots from image_hash, not just cdn_url
Gallery.vue displayed screenshots from `cdn_url` and SKIPPED any row that lacked it. Reuse galgameImageSrc (cdn_url ?? /image/<hash>) so a screenshot still renders from image_hash alone via the web 302 middleware instead of being silently dropped — the same robustness the cover/gallery editor now has. Guard on image_hash (a row that can't reference any image) rather than on the derived cdn_url.
1 parent 9a7cb8d commit 4118648

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

apps/web/app/components/galgame/Gallery.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
// no carousel. Empty list → render nothing (the section disappears so
88
// older galgames with no screenshots don't get an empty placeholder).
99
//
10-
// Image source: each row's `cdn_url` (kungal injects it via
11-
// rewriteBanners). If a row somehow lacks `cdn_url` we skip it rather
12-
// than show a broken image.
10+
// Image source: galgameImageSrc resolves each row's cdn_url (kungal injects
11+
// it via rewriteBanners) and falls back to the /image/<hash> token (web 302
12+
// middleware) when a row arrives without cdn_url — so a screenshot still
13+
// shows from image_hash alone instead of being silently dropped.
1314
const props = defineProps<{
1415
screenshots: GalgameScreenshot[]
1516
}>()
1617
1718
const sorted = computed(() =>
1819
[...(props.screenshots ?? [])]
19-
.filter((s) => !!s.cdn_url)
20+
.filter((s) => !!s.image_hash)
2021
.sort((a, b) => {
2122
if (a.sort_order !== b.sort_order) return a.sort_order - b.sort_order
2223
return a.image_hash.localeCompare(b.image_hash)
@@ -55,7 +56,7 @@ const open = (hash: string) => {
5556
@click="open(s.image_hash)"
5657
>
5758
<KunImage
58-
:src="s.cdn_url!"
59+
:src="galgameImageSrc(s)"
5960
:alt="s.caption || ''"
6061
loading="lazy"
6162
class-name="aspect-video w-full object-cover transition-transform duration-200 group-hover:scale-105"
@@ -72,7 +73,7 @@ const open = (hash: string) => {
7273
<KunModal v-model="isOpen" inner-class-name="max-w-4xl">
7374
<div v-if="active" class="space-y-2">
7475
<KunImage
75-
:src="active.cdn_url!"
76+
:src="galgameImageSrc(active)"
7677
:alt="active.caption || ''"
7778
class-name="max-h-[80vh] w-full object-contain"
7879
/>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kun-galgame-forum",
3-
"version": "6.0.21",
3+
"version": "6.0.22",
44
"private": true,
55
"packageManager": "pnpm@10.12.1",
66
"workspaces": [

0 commit comments

Comments
 (0)