diff --git a/src/renderer/src/components/ClipDetail/ClipDetailModal.vue b/src/renderer/src/components/ClipDetail/ClipDetailModal.vue index a87abdb..1551802 100644 --- a/src/renderer/src/components/ClipDetail/ClipDetailModal.vue +++ b/src/renderer/src/components/ClipDetail/ClipDetailModal.vue @@ -58,7 +58,7 @@ import { useClipNeighbours } from '@renderer/composables/clips/useClipNeighbours * with the video, which gave real weight to the one thing nobody opens a clip * to find out. Still there, and now they read as a footnote. */ -const { openClipId, view, close, show, back, open } = useClipDetail(); +const { openClipId, view, close, show, back, open, countsAsOpen } = useClipDetail(); const toastStore = useToastStore(); const collectionsStore = useCollectionsStore(); @@ -112,9 +112,12 @@ watch( * Here rather than anywhere finer grained: this watcher fires once per * open, where a Range request fires several times a second. */ - void recordClipOpened(id).catch((error) => { - console.debug('Could not record that this clip was opened:', error); - }); + // Not when Storage Saver opened it: see `countsAsOpen`. + if (countsAsOpen.value) { + void recordClipOpened(id).catch((error) => { + console.debug('Could not record that this clip was opened:', error); + }); + } // A clip opened after another should not inherit the last one's expanded // date or a half-open sheet. diff --git a/src/renderer/src/components/Storage/StorageClipTile.vue b/src/renderer/src/components/Storage/StorageClipTile.vue index 00cee31..a3188c7 100644 --- a/src/renderer/src/components/Storage/StorageClipTile.vue +++ b/src/renderer/src/components/Storage/StorageClipTile.vue @@ -134,7 +134,7 @@ const frame = computed(() => [ type="button" :class="['group/pic relative block w-full aspect-21/9 bg-video-bed cursor-pointer', FOCUS_RING]" :aria-label="`Watch ${title}`" - @click="openClip(clip.id)" + @click="openClip(clip.id, 'details', { countAsOpen: false })" @mousemove="preview" @mouseleave="stopPreview" > diff --git a/src/renderer/src/composables/clips/useClipDetail.ts b/src/renderer/src/composables/clips/useClipDetail.ts index 992aa26..ec1489e 100644 --- a/src/renderer/src/composables/clips/useClipDetail.ts +++ b/src/renderer/src/composables/clips/useClipDetail.ts @@ -42,14 +42,29 @@ const view = ref('details'); */ const cameFrom = ref<'library' | 'details'>('details'); +/** + * Whether this opening counts as somebody watching the clip. + * + * False only when Storage Saver opens it. That screen lists the clips nobody + * ever opened, and a look is how somebody there decides whether to delete + * one, so counting it would take the clip off the list the moment it was + * watched: it could never be deleted from the screen that exists to delete + * it. Held for as long as the layer is open, so stepping to the next clip + * inside it does not start counting, and put back on close. + */ +const countsAsOpen = ref(true); + export function useClipDetail() { return { openClipId, view, cameFrom, + countsAsOpen, + /** Open the layer from nothing, on whichever panel was asked for. */ - open: (id: number, as: ClipView = 'details') => { + open: (id: number, as: ClipView = 'details', options: { countAsOpen?: boolean } = {}) => { + countsAsOpen.value = options.countAsOpen ?? true; openClipId.value = id; view.value = as; cameFrom.value = 'library'; @@ -81,6 +96,7 @@ export function useClipDetail() { * to reset. */ close: () => { + countsAsOpen.value = true; openClipId.value = null; }, };