More robust doesVideoExistForVideoFile

pull/6527/head
Chocobozzz 2024-07-31 08:55:56 +02:00
parent 601bf7ad96
commit 71857cc04b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 0 deletions

View File

@ -352,6 +352,8 @@ export class VideoFileModel extends SequelizeModel<VideoFileModel> {
return VideoFileModel.scope({ method: [ ScopeNames.WITH_VIDEO_OR_PLAYLIST, whereVideo ] })
.findOne(options)
.then(file => {
if (!file) return null
// We used `required: false` so check we have at least a video or a streaming playlist
if (!file.Video && !file.VideoStreamingPlaylist) return null