Serve the stage from a 1600px preview instead of the grid thumb.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-29 20:57:01 -05:00
co-authored by Cursor
parent ccf852cb0c
commit 17bb42bea4
4 changed files with 113 additions and 10 deletions
+27 -4
View File
@@ -302,13 +302,14 @@
/>
</template>
<template v-else-if="selected">
<img
<img
v-show="!isHidden(selected)"
:key="selected.id"
:key="selected.id+'-'+stagePreviewNonce"
class="viewer-still"
:src="stillThumbUrl(selected.id)"
:src="stagePreviewSrc"
alt="Selected still"
decoding="async"
@error="onStagePreviewError"
>
</template>
<template v-else>
@@ -700,7 +701,25 @@ const stills=computed(()=>library.value.stills.filter((s:any)=>s.folderId===form
const clips=computed(()=>library.value.clips.filter((s:any)=>s.folderId===form.folderId))
const stillUrl=(id:string)=>`/api/library/stills/${id}`
const stillThumbUrl=(id:string)=>`/api/library/stills/${id}/thumb`
/** Stage always uses /thumb — never auto-upgrade to the archive master. */
const stillPreviewUrl=(id:string)=>`/api/library/stills/${id}/preview`
/** Stage uses /preview (1600px). Tiles keep /thumb. Never auto-upgrade to the archive master. */
const stagePreviewNonce=ref(0)
const stagePreviewRetries=ref(0)
const stagePreviewSrc=computed(()=>{
const id=selected.value?.id
if(!id || selected.value?.kind==='clip' || selected.value?.kind==='track') return ''
const base=stillPreviewUrl(id)
return stagePreviewNonce.value?`${base}?t=${stagePreviewNonce.value}`:base
})
function onStagePreviewError(){
if(!selected.value?.id || stagePreviewRetries.value>=8) return
stagePreviewRetries.value+=1
window.setTimeout(()=>{
if(!selected.value?.id) return
stagePreviewNonce.value=Date.now()
}, 700)
}
watch(()=>selected.value?.id,()=>{stagePreviewNonce.value=0;stagePreviewRetries.value=0})
const folderJobs=computed(()=>jobs.value.filter(j=>j.request.folderId===form.folderId))
const benchJobs=computed(()=>queueJobs(folderJobs.value))
const musicJobs=computed(()=>studioQueue.value
@@ -1666,6 +1685,10 @@ const mobileCtx=computed(()=>({
aspectOptions,
stillUrl,
stillThumbUrl,
stillPreviewUrl,
stagePreviewSrc:stagePreviewSrc.value,
stagePreviewNonce:stagePreviewNonce.value,
onStagePreviewError,
isHidden,
slotHidden,
stillById,
+3 -2
View File
@@ -123,11 +123,12 @@
<img
v-else-if="ctx.selected"
v-show="!ctx.isHidden(ctx.selected)"
:key="ctx.selected.id"
:key="ctx.selected.id+'-'+(ctx.stagePreviewNonce||0)"
class="m-stage-still"
:src="ctx.stillThumbUrl(ctx.selected.id)"
:src="ctx.stagePreviewSrc || ctx.stillPreviewUrl(ctx.selected.id)"
alt="Selected still"
decoding="async"
@error="ctx.onStagePreviewError?.()"
>
<p v-else class="m-muted">Open Library to pick a still or clip</p>
</div>