mirror of https://github.com/Chocobozzz/PeerTube
More robust doesVideoExistForVideoFile
parent
601bf7ad96
commit
71857cc04b
|
@ -352,6 +352,8 @@ export class VideoFileModel extends SequelizeModel<VideoFileModel> {
|
||||||
return VideoFileModel.scope({ method: [ ScopeNames.WITH_VIDEO_OR_PLAYLIST, whereVideo ] })
|
return VideoFileModel.scope({ method: [ ScopeNames.WITH_VIDEO_OR_PLAYLIST, whereVideo ] })
|
||||||
.findOne(options)
|
.findOne(options)
|
||||||
.then(file => {
|
.then(file => {
|
||||||
|
if (!file) return null
|
||||||
|
|
||||||
// We used `required: false` so check we have at least a video or a streaming playlist
|
// We used `required: false` so check we have at least a video or a streaming playlist
|
||||||
if (!file.Video && !file.VideoStreamingPlaylist) return null
|
if (!file.Video && !file.VideoStreamingPlaylist) return null
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue