fix(video): prevent thumbnail update for queued/in_progress videos

When a video is in 'queued' or 'in_progress' status, setting a thumbnail is not meaningful and could cause issues. This change ensures thumbnail remains undefined for these states.
This commit is contained in:
icarus 2025-10-13 23:08:44 +08:00
parent 09ed82eb49
commit 4e76806cc3

View File

@ -39,7 +39,14 @@ const videoSlice = createSlice({
if (videos) {
let video = videos.find((v) => v.id === update.id)
if (video) {
video = { ...video, ...update }
switch (video.status) {
case 'queued':
case 'in_progress':
video = { ...video, ...update, thumbnail: undefined }
break
default:
video = { ...video, ...update }
}
} else {
logger.error(`Video with id ${update.id} not found in ${providerId}`)
}