fix(search): preview matched video chunks on hover (#540)

* fix(search): preview matched video chunks on hover

* fix(search): show chunk covers before hover

* fix(search): reuse sprites for whole-video matches
This commit is contained in:
Yiling-J
2026-11-23 11:42:00 +08:00
committed by GitHub
parent aabf59cbe7
commit eeb41fee03
28 changed files with 1018 additions and 249 deletions
@@ -0,0 +1,20 @@
import { s3Service } from '@shumai/core/src/s3/s3'
export function isFullVideoRange(
startTime: number | null,
endTime: number | null,
duration: unknown,
): boolean {
return (
startTime === 0 &&
typeof duration === 'number' &&
Number.isFinite(duration) &&
duration > 0 &&
endTime === duration
)
}
export async function hasStoredVideoSprite(bucket: string, key: string): Promise<boolean> {
const size = await s3Service.getObjectSize(bucket, key).catch(() => 0)
return size > 0
}