1
0
Fork 0

More robust doesVideoExistForVideoFile

This commit is contained in:
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

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