mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 10:55:27 +00:00
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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user