Delete library stills from disk before the catalog write, and stop caching their media.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-10-25 17:55:30 -05:00
co-authored by Cursor
parent 545a3d749b
commit 20359bfbd4
26 changed files with 635 additions and 247 deletions
+6 -6
View File
@@ -135,16 +135,16 @@ const visibleSlots = computed(() => {
})
function frameThumb(key: SlotKey) {
if (key === 'still' && props.stillId) return `/api/library/stills/${props.stillId}?thumb=1`
if (key === 'from' && props.fromClipId) return `/api/library/clips/${props.fromClipId}/last-frame?thumb=1&v=parent`
if (key === 'first' && props.clipId) return `/api/library/clips/${props.clipId}/first-frame?thumb=1&v=join`
if (key === 'still' && props.stillId) return `/api/library/stills/${props.stillId}?thumb=1&v=0`
if (key === 'from' && props.fromClipId) return `/api/library/clips/${props.fromClipId}/last-frame?thumb=1&v=parent&e=0`
if (key === 'first' && props.clipId) return `/api/library/clips/${props.clipId}/first-frame?thumb=1&v=join&e=0`
return ''
}
function frameFull(key: SlotKey) {
if (key === 'still' && props.stillId) return `/api/library/stills/${props.stillId}`
if (key === 'from' && props.fromClipId) return `/api/library/clips/${props.fromClipId}/last-frame?v=parent`
if (key === 'first' && props.clipId) return `/api/library/clips/${props.clipId}/first-frame?v=join`
if (key === 'still' && props.stillId) return `/api/library/stills/${props.stillId}?v=0`
if (key === 'from' && props.fromClipId) return `/api/library/clips/${props.fromClipId}/last-frame?v=parent&e=0`
if (key === 'first' && props.clipId) return `/api/library/clips/${props.clipId}/first-frame?v=join&e=0`
return ''
}
+1 -1
View File
@@ -95,7 +95,7 @@
>
<div class="relative h-28 overflow-hidden bg-zinc-900">
<img
:src="`/api/library/stills/${still.id}/thumb`"
:src="`/api/library/stills/${still.id}/thumb?v=${still.createdAt || 0}`"
alt=""
loading="lazy"
decoding="async"
+1 -1
View File
@@ -14,7 +14,7 @@
<span v-if="hidden" class="sensitive-glow block h-full w-full" />
<img
v-else
:src="`/api/library/stills/${item.stillId}?thumb=1`"
:src="`/api/library/stills/${item.stillId}?thumb=1&v=0`"
alt=""
loading="lazy"
decoding="async"
+1 -1
View File
@@ -240,7 +240,7 @@ const shots = computed(() => job.value ? queuedJobShots(currentPayload(), job.va
const thumbUrl = computed(() => {
const stillId = job.value?.payload?.stillId
if (!stillId || job.value?.payload?.hideThumbnail || job.value?.payload?.folderLocked) return ''
return `/api/library/stills/${stillId}`
return `/api/library/stills/${stillId}?v=0`
})
const loraLine = computed(() => loraStackLabel(draft.loraStack, loraAliases.value))
const loraEngine = computed(() => {
+6 -4
View File
@@ -44,17 +44,19 @@
</div>
</template>
<script setup lang="ts">
import { libraryMediaUrl } from '~/shared/studio2/viewer.mjs'
const props = withDefaults(defineProps<{
asset?: any
hidden?: boolean
role: string
roleOptions: { id: string; label: string }[]
readonly?: boolean
}>(), { readonly: false, hidden: false })
version?: string | number
}>(), { readonly: false, hidden: false, version: 0 })
defineEmits(['pick', 'remove', 'mention', 'update:role'])
const thumbSrc = computed(() => {
if (!props.asset) return ''
if (props.asset.kind === 'clip') return `/api/library/clips/${props.asset.id}/thumb`
return `/api/library/stills/${props.asset.id}/thumb`
if (!props.asset?.id) return ''
if (props.asset.kind === 'clip') return libraryMediaUrl(`/api/library/clips/${props.asset.id}/thumb`, props.version)
return libraryMediaUrl(`/api/library/stills/${props.asset.id}/thumb`, props.version)
})
</script>
+83 -42
View File
@@ -96,6 +96,7 @@
v-for="(card, index) in form.photos"
:key="'photo-'+index+'-'+card.stillId"
:asset="stillById(card.stillId)"
:version="library.catalogEpoch || 0"
:hidden="hideInputs"
:role="card.role"
:role-options="photoRoleOptions"
@@ -316,7 +317,7 @@
v-show="!isHidden(selected)"
ref="viewerVideo"
:key="selected.id"
:src="`/api/library/clips/${selected.id}/video`"
:src="clipVideoUrl(selected.id)"
:muted="viewerMuted"
@timeupdate="onVideoTime"
@loadedmetadata="onVideoTime"
@@ -476,7 +477,7 @@
<div class="grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-5">
<button v-for="a in pickerAssets" :key="a.id" type="button" class="rounded-[var(--radius)] border border-[var(--line)] p-2 text-left" @click="pickAsset(a)">
<span v-if="pickerThumbHidden(a)" class="flex h-24 items-center text-xs text-[var(--muted)]">Still loaded · preview hidden</span>
<img v-else :src="a.kind==='clip'?'/api/library/clips/'+a.id+'/thumb':stillThumbUrl(a.id)" class="h-24 w-full object-contain" alt="">
<img v-else :src="a.kind==='clip'?clipThumbUrl(a.id):stillThumbUrl(a.id)" class="h-24 w-full object-contain" alt="">
<span class="mt-2 block truncate text-xs">{{ assetLabel(a) }}</span>
</button>
</div>
@@ -491,7 +492,7 @@ import {createLoraMemory,loraUse} from '~/shared/studio2/lora-memory.mjs'
import {filterLorasForStudio,filterLorasForUse} from '~/utils/loras'
import {sectionsFrom} from '~/shared/studio2/contracts.mjs'
import {aspectOptions,resolveSize,bindClip,restoreAll,useAsSource,hydrateStudio2Job} from '~/shared/studio2/input.mjs'
import {folderAssets,newestOutput,assetLabel,reconcileSelection,previewHidden,folderImageCount,libraryAfterWipe} from '~/shared/studio2/viewer.mjs'
import {folderAssets,newestOutput,assetLabel,reconcileSelection,previewHidden,folderImageCount,libraryAfterWipe,libraryMediaUrl} from '~/shared/studio2/viewer.mjs'
import {queueJobs,queueEngineLabel,jobStageLabel,jobProgressView,elapsedSeconds} from '~/shared/studio2/queue-view.mjs'
import {gpuStatus} from '~/shared/studio2/status.mjs'
import {CAPTION_STYLES} from '~/shared/caption.mjs'
@@ -921,9 +922,12 @@ watch(()=>form.folderId,(id,prev)=>{
watch(()=>form.identityStillId,id=>{if(import.meta.client&&form.folderId&&form.engine!=='qwen21')localStorage.setItem(`studio2-hero:${form.folderId}`,id)})
const stills=computed(()=>library.value.stills.filter((s:any)=>s.folderId===form.folderId))
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`
const stillPreviewUrl=(id:string)=>`/api/library/stills/${id}/preview`
const mediaVersion=()=>library.value.catalogEpoch ?? 0
const stillUrl=(id:string)=>libraryMediaUrl(`/api/library/stills/${id}`,mediaVersion())
const stillThumbUrl=(id:string)=>libraryMediaUrl(`/api/library/stills/${id}/thumb`,mediaVersion())
const stillPreviewUrl=(id:string)=>libraryMediaUrl(`/api/library/stills/${id}/preview`,mediaVersion())
const clipThumbUrl=(id:string)=>libraryMediaUrl(`/api/library/clips/${id}/thumb`,mediaVersion())
const clipVideoUrl=(id:string)=>libraryMediaUrl(`/api/library/clips/${id}/video`,mediaVersion())
/** Stage uses /preview (1600px). Tiles keep /thumb. Never auto-upgrade to the archive master. */
const stagePreviewNonce=ref(0)
const stagePreviewRetries=ref(0)
@@ -931,7 +935,7 @@ 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
return stagePreviewNonce.value?`${base}&t=${stagePreviewNonce.value}`:base
})
function onStagePreviewError(){
if(!selected.value?.id || stagePreviewRetries.value>=8) return
@@ -982,10 +986,7 @@ const showSelectedStill=computed(()=>{
const item=selected.value
if(!item?.id || item.kind==='clip' || item.kind==='track') return false
if(forgottenStillIds.value.has(item.id)) return false
if((library.value.stills||[]).some((s:any)=>s.id===item.id)) return true
const folder=(library.value.folders||[]).find((f:any)=>f.id===(item.folderId||form.folderId))
if(folder && typeof folder.imageCount==='number' && folder.imageCount===0) return false
return true
return (library.value.stills||[]).some((s:any)=>s.id===item.id)
})
const sourceAsset=computed(()=>form.startClipId?clips.value.find((c:any)=>c.id===form.startClipId):stills.value.find((s:any)=>s.id===(form.imageAId||form.identityStillId||form.photos?.[0]?.stillId)))
const sourceSize=computed(()=>measured[sourceAsset.value?.id] || sourceAsset.value)
@@ -1133,6 +1134,30 @@ function clearFormSlots(ids:string[]){
selectionPinned.value=false
}
}
function clearRefsMissingFromLibrary(){
const ids=new Set((library.value.stills||[]).map((s:any)=>s.id))
const clipIds=new Set((library.value.clips||[]).map((c:any)=>c.id))
const trackIds=new Set((library.value.tracks||[]).map((t:any)=>t.id))
const missing=[
form.imageAId,form.imageBId,form.identityStillId,form.maskId,form.endStillId,
...(form.photos||[]).map((p:any)=>p?.stillId),
...(form.guides||[]).map((g:any)=>g?.stillId)
].filter((id:string)=>id&&!ids.has(id))
clearFormSlots(missing)
if(form.startClipId&&!clipIds.has(form.startClipId))form.startClipId=''
if(form.identityStillId&&!ids.has(form.identityStillId)){
form.identityStillId=''
try{localStorage.removeItem(`studio2-hero:${form.folderId}`)}catch{/* ignore */}
}
const sel=selected.value
if(sel?.id){
const ok=sel.kind==='clip'?clipIds.has(sel.id):sel.kind==='track'?trackIds.has(sel.id):ids.has(sel.id)
if(!ok){
selected.value=null
selectionPinned.value=false
}
}
}
/** Photos array is source of truth — never resurrect cards from leftover imageAId. */
function syncPhotosBindings(){
const filled=(form.photos||[]).filter((p:any)=>p?.stillId)
@@ -1495,6 +1520,7 @@ async function deleteOutput(explicit?:any){
return
}
}
seenOutputs.add(id)
forgottenStillIds.value=new Set([...forgottenStillIds.value,id])
clearFormSlots([id])
library.value={
@@ -1503,9 +1529,13 @@ async function deleteOutput(explicit?:any){
clips:(library.value.clips||[]).filter((c:any)=>c.id!==id),
tracks:(library.value.tracks||[]).filter((t:any)=>t.id!==id)
}
if(selected.value?.id===id)selected.value=null
if(selected.value?.id===id){
selected.value=null
selectionPinned.value=false
}
libraryRefreshKey.value+=1
try{await loadLibraryOnce()}catch{/* catalog write already landed */}
try{await loadLibraryOnce([id])}catch{/* local rows already dropped */ }
forgottenStillIds.value=new Set()
await refreshJobs()
}
function stepFamily(delta:number){
@@ -1549,19 +1579,24 @@ function onLibraryDelete(item:any){
}
function onLibraryWiped(result:any){
const folderId=String(result?.folderId||form.folderId||'')
const deleted=[
...(result?.deletedIds||[]),
...(library.value.stills||[]).filter((s:any)=>String(s.folderId||'')===folderId).map((s:any)=>s.id),
...(library.value.clips||[]).filter((s:any)=>String(s.folderId||'')===folderId).map((s:any)=>s.id),
...(library.value.tracks||[]).filter((s:any)=>String(s.folderId||'')===folderId).map((s:any)=>s.id)
]
for(const id of deleted) seenOutputs.add(id)
const next=libraryAfterWipe({
folders:library.value.folders,
stills:library.value.stills,
clips:library.value.clips,
tracks:library.value.tracks,
suppressedIds:[...forgottenStillIds.value]
suppressedIds:[]
}, result, folderId)
forgottenStillIds.value=new Set(next.suppressedIds)
clearFormSlots(next.suppressedIds)
if(selected.value && (forgottenStillIds.value.has(selected.value.id) || String(selected.value.folderId||'')===folderId)){
selected.value=null
selectionPinned.value=false
}
forgottenStillIds.value=new Set(deleted)
clearFormSlots(deleted)
selected.value=null
selectionPinned.value=false
library.value={
...library.value,
folders:next.folders,
@@ -1571,10 +1606,12 @@ function onLibraryWiped(result:any){
drafts:result?.drafts||[],
loraAliases:result?.loraAliases||library.value.loraAliases||{},
loraTriggers:result?.loraTriggers||library.value.loraTriggers||{},
keepPrompts:result?.keepPrompts||library.value.keepPrompts
keepPrompts:result?.keepPrompts||library.value.keepPrompts,
catalogEpoch:result?.catalogEpoch??library.value.catalogEpoch??0
}
clearRefsMissingFromLibrary()
libraryRefreshKey.value+=1
void loadLibraryOnce()
void loadLibraryOnce(deleted).finally(()=>{forgottenStillIds.value=new Set()})
}
function onStageHotkey(e:KeyboardEvent){
if(e.metaKey||e.ctrlKey||e.altKey)return
@@ -1714,7 +1751,7 @@ watch(()=>sourceAsset.value?.id,id=>{
media.addEventListener('loadedmetadata',()=>{
measured[asset.id]={width:media.videoWidth,height:media.videoHeight}
},{once:true})
media.src=`/api/library/clips/${asset.id}/video`
media.src=clipVideoUrl(asset.id)
}
})
watch(()=>selected.value?.id,()=>{videoTime.value=0;videoDuration.value=0})
@@ -2013,50 +2050,51 @@ async function cancel(job:any){
}
let libraryLoadGen=0
async function loadLibraryOnce(){
async function loadLibraryOnce(deletedIds?: string[]){
// Current folder page only — never the yearly Inbox JSON on /
// After delete/wipe, replace from this response. Do not merge the pre-delete list.
const replacing=Array.isArray(deletedIds)
const gone=new Set(deletedIds||[])
const gen=++libraryLoadGen
const qs=new URLSearchParams({limit:'50'})
if(form.folderId) qs.set('folderId',form.folderId)
qs.set('_',String(Date.now()))
const page=await $fetch<any>(`/api/library?${qs.toString()}`)
if(gen!==libraryLoadGen) return
const pageStills=page.stills||[]
const pageStills=(page.stills||[]).filter((s:any)=>s?.id&&!gone.has(s.id))
const forget=forgottenStillIds.value
const keepIds=[
...(form.photos||[]).map((p:any)=>p?.stillId).filter(Boolean),
form.imageAId,form.imageBId,form.identityStillId,form.maskId,form.endStillId,
...(form.guides||[]).map((g:any)=>g?.stillId).filter(Boolean)
].filter((id:string)=>id&&!forget.has(id)) as string[]
let kept=(library.value.stills||[]).filter((s:any)=>keepIds.includes(s.id)&&!pageStills.some((p:any)=>p.id===s.id)&&!forget.has(s.id))
const stillMissing=keepIds.filter(id=>!forget.has(id)&&!pageStills.some((s:any)=>s.id===id)&&!kept.some((s:any)=>s.id===id))
// Draft / upload stills must survive reload even when they fall outside the first page
].filter((id:string)=>id&&!forget.has(id)&&!gone.has(id)) as string[]
let kept=replacing?[]:(library.value.stills||[]).filter((s:any)=>keepIds.includes(s.id)&&!pageStills.some((p:any)=>p.id===s.id)&&!forget.has(s.id)&&!gone.has(s.id))
const stillMissing=keepIds.filter(id=>!pageStills.some((s:any)=>s.id===id)&&!kept.some((s:any)=>s.id===id))
let epoch=page.catalogEpoch
// Draft / upload stills must survive reload even when they fall outside the first page.
// A delete replace only accepts ids the fresh catalog still returns.
if(stillMissing.length){
try{
const full=await $fetch<any>(`/api/library?light=1&_=${Date.now()}`)
if(gen!==libraryLoadGen) return
const recovered=(full.stills||[]).filter((s:any)=>stillMissing.includes(s.id)&&!forget.has(s.id))
if(typeof full?.catalogEpoch==='number') epoch=full.catalogEpoch
const recovered=(full.stills||[]).filter((s:any)=>stillMissing.includes(s.id)&&!forget.has(s.id)&&!gone.has(s.id))
kept=[...kept,...recovered.filter((s:any)=>!kept.some((k:any)=>k.id===s.id))]
}catch{/* keep page + in-memory stills */}
}catch{if(replacing) kept=[]}
}
if(gen!==libraryLoadGen) return
library.value={
folders:page.folders||library.value.folders||[],
stills:[...pageStills,...kept].filter((s:any)=>!forget.has(s.id)),
clips:(page.clips||[]).filter((c:any)=>!forget.has(c.id)),
tracks:(page.tracks||[]).filter((t:any)=>!forget.has(t.id)),
stills:[...pageStills,...kept].filter((s:any)=>s?.id&&!forget.has(s.id)&&!gone.has(s.id)),
clips:(page.clips||[]).filter((c:any)=>c?.id&&!forget.has(c.id)&&!gone.has(c.id)),
tracks:(page.tracks||[]).filter((t:any)=>t?.id&&!forget.has(t.id)&&!gone.has(t.id)),
drafts:page.drafts||library.value.drafts||[],
loraAliases:page.loraAliases||library.value.loraAliases||{},
loraTriggers:page.loraTriggers||library.value.loraTriggers||{},
keepPrompts:page.keepPrompts||library.value.keepPrompts
keepPrompts:page.keepPrompts||library.value.keepPrompts,
catalogEpoch:typeof epoch==='number'?epoch:(library.value.catalogEpoch??0)
}
const allStills=[...pageStills,...kept]
// Drop filled photo cards only when the still is truly gone from the catalog
for(let i=(form.photos||[]).length-1;i>=0;i-=1){
const id=form.photos[i]?.stillId
if(id && !allStills.some((s:any)=>s.id===id)) form.photos[i].stillId=''
}
syncPhotosBindings()
clearRefsMissingFromLibrary()
}
async function fetchHealth(){
@@ -2098,6 +2136,7 @@ onMounted(()=>{
// Folder page in background — never blocks Generate / prompt
void loadLibraryOnce().then(()=>{
restoreBenchDraft()
clearRefsMissingFromLibrary()
if(!form.folderId)form.folderId=library.value.folders[0]?.id||''
loadRevealed(form.folderId)
void applyIncomingGenerationLoad()
@@ -2159,6 +2198,8 @@ const mobileCtx=computed(()=>({
libraryRefreshKey:libraryRefreshKey.value,
family:family.value,
familyStillCount:familyStillCount.value,
clipThumbUrl,
clipVideoUrl,
showSelectedStill:showSelectedStill.value,
libraryOpen:libraryOpen.value,
eyeOpen:eyeOpen.value,
+29 -21
View File
@@ -154,7 +154,7 @@ import {
type LibraryTrack
} from '~/utils/libraryBrowse'
import { clipSettingsRows, stillSettingsRows, trackSettingsRows } from '~/utils/libraryGeneration'
import { assetLabel, libraryAfterWipe, mergeLibraryRows, replaceLibraryRows } from '~/shared/studio2/viewer.mjs'
import { assetLabel, libraryAfterWipe, libraryMediaUrl, mergeLibraryRows } from '~/shared/studio2/viewer.mjs'
const props = defineProps<{
open: boolean
@@ -201,7 +201,7 @@ const tracks = ref<LibraryTrack[]>([])
const fetchedAt = ref(0)
const nextCursor = ref<string | null>(null)
const liveThumbs = ref(new Set<string>())
const suppressedDeletedIds = ref(new Set<string>())
const catalogEpoch = ref(0)
const wipeBusy = ref(false)
const pendingWipe = ref<{ folderId: string; name: string; count: number } | null>(null)
let thumbObserver: IntersectionObserver | null = null
@@ -252,9 +252,14 @@ const detailRows = computed(() => {
})
function thumbSrc(entry: LibraryEntry) {
if (entry.kind === 'clip' && entry.group) return `/api/library/clips/${entry.group.head.id}/thumb`
const version = catalogEpoch.value
if (entry.kind === 'clip' && entry.group) return libraryMediaUrl(`/api/library/clips/${entry.group.head.id}/thumb`, version)
if (entry.kind === 'track') return ''
if (entry.stillGroup) return `/api/library/stills/${entry.stillGroup.head.id}/thumb`
if (entry.stillGroup) {
const id = entry.stillGroup.head.id
if (!stills.value.some(item => item.id === id)) return ''
return libraryMediaUrl(`/api/library/stills/${id}/thumb`, version)
}
return ''
}
@@ -289,10 +294,6 @@ function useAndClose() {
close()
}
function dropIds() {
return new Set([...(props.hiddenIds || []), ...suppressedDeletedIds.value])
}
function onDeleteClick() {
const asset = detailAsset.value
if (!asset?.id) return
@@ -301,15 +302,16 @@ function onDeleteClick() {
function applyLibraryPage(data: any, replace: boolean) {
if (Array.isArray(data?.folders) && data.folders.length) folders.value = data.folders
const drop = [...dropIds()]
if (typeof data?.catalogEpoch === 'number') catalogEpoch.value = data.catalogEpoch
const rows = (list: any[]) => (Array.isArray(list) ? list : []).filter(item => item?.id)
if (replace) {
clips.value = replaceLibraryRows(data?.clips || [], drop) as LibraryClip[]
stills.value = replaceLibraryRows(data?.stills || [], drop) as LibraryStill[]
tracks.value = replaceLibraryRows(data?.tracks || [], drop) as LibraryTrack[]
clips.value = rows(data?.clips) as LibraryClip[]
stills.value = rows(data?.stills) as LibraryStill[]
tracks.value = rows(data?.tracks) as LibraryTrack[]
} else {
clips.value = mergeLibraryRows(clips.value, data?.clips || [], drop) as LibraryClip[]
stills.value = mergeLibraryRows(stills.value, data?.stills || [], drop) as LibraryStill[]
tracks.value = mergeLibraryRows(tracks.value, data?.tracks || [], drop) as LibraryTrack[]
clips.value = mergeLibraryRows(clips.value, data?.clips || [], []) as LibraryClip[]
stills.value = mergeLibraryRows(stills.value, data?.stills || [], []) as LibraryStill[]
tracks.value = mergeLibraryRows(tracks.value, data?.tracks || [], []) as LibraryTrack[]
}
nextCursor.value = data?.nextCursor ?? null
fetchedAt.value = Date.now()
@@ -337,9 +339,6 @@ async function confirmWipeFolder() {
...clips.value.filter(item => item.folderId === pending.folderId).map(item => item.id),
...tracks.value.filter(item => item.folderId === pending.folderId).map(item => item.id)
]
const pendingIds = new Set(suppressedDeletedIds.value)
for (const id of gone) pendingIds.add(id)
suppressedDeletedIds.value = pendingIds
stills.value = stills.value.filter(item => item.folderId !== pending.folderId)
clips.value = clips.value.filter(item => item.folderId !== pending.folderId)
tracks.value = tracks.value.filter(item => item.folderId !== pending.folderId)
@@ -350,16 +349,16 @@ async function confirmWipeFolder() {
stills: [...stills.value, ...gone.map(id => ({ id, folderId: pending.folderId }))],
clips: clips.value,
tracks: tracks.value,
suppressedIds: [...suppressedDeletedIds.value]
suppressedIds: []
}, result, pending.folderId)
suppressedDeletedIds.value = new Set(next.suppressedIds)
if (typeof result?.catalogEpoch === 'number') catalogEpoch.value = result.catalogEpoch
folders.value = next.folders
stills.value = next.stills as LibraryStill[]
clips.value = next.clips as LibraryClip[]
tracks.value = next.tracks as LibraryTrack[]
nextCursor.value = null
fetchedAt.value = 0
emit('wiped', { ...result, folderId: pending.folderId, suppressedIds: next.suppressedIds })
emit('wiped', { ...result, folderId: pending.folderId, deletedIds: [...new Set([...(result?.deletedIds || []), ...gone])] })
await fetchLibrary(true)
} catch (e: any) {
loadError.value = e?.data?.statusMessage || e?.message || 'Could not empty that folder'
@@ -500,9 +499,18 @@ watch([filter, activeFolderId], () => {
watch(() => props.refreshKey, () => {
if (!props.open) return
fetchGen += 1
void fetchLibrary(true)
})
watch(() => (props.hiddenIds || []).join('\n'), () => {
const drop = new Set(props.hiddenIds || [])
if (!drop.size) return
stills.value = stills.value.filter(item => !drop.has(item.id))
clips.value = clips.value.filter(item => !drop.has(item.id))
tracks.value = tracks.value.filter(item => !drop.has(item.id))
})
onBeforeUnmount(() => {
if (import.meta.client) {
document.body.style.overflow = ''
+1 -1
View File
@@ -120,7 +120,7 @@
v-else-if="ctx.selected?.kind==='clip'"
v-show="!ctx.isHidden(ctx.selected)"
:key="ctx.selected.id"
:src="`/api/library/clips/${ctx.selected.id}/video`"
:src="ctx.clipVideoUrl(ctx.selected.id)"
controls
playsinline
/>