const [ html, video ] = await Promise.all([
ClientHtml.getIndexHTML(req, res),
- VideoModel.load(videoId)
+ VideoModel.loadWithBlacklist(videoId)
])
// Let Angular application handle errors
- if (!video || video.privacy === VideoPrivacy.PRIVATE) {
+ if (!video || video.privacy === VideoPrivacy.PRIVATE || video.VideoBlacklist) {
return ClientHtml.getIndexHTML(req, res)
}
MVideoFullLight,
MVideoIdThumbnail,
MVideoThumbnail,
+ MVideoThumbnailBlacklist,
MVideoWithAllFiles,
MVideoWithFile,
MVideoWithRights
return VideoModel.scope(ScopeNames.WITH_THUMBNAILS).findOne(options)
}
+ static loadWithBlacklist (id: number | string, t?: Transaction): Bluebird<MVideoThumbnailBlacklist> {
+ const where = buildWhereIdOrUUID(id)
+ const options = {
+ where,
+ transaction: t
+ }
+
+ return VideoModel.scope([
+ ScopeNames.WITH_THUMBNAILS,
+ ScopeNames.WITH_BLACKLISTED
+ ]).findOne(options)
+ }
+
static loadWithRights (id: number | string, t?: Transaction): Bluebird<MVideoWithRights> {
const where = buildWhereIdOrUUID(id)
const options = {
Use<'VideoFiles', MVideoFile[]> &
Use<'Thumbnails', MThumbnail[]>
+export type MVideoThumbnailBlacklist = MVideo &
+ Use<'Thumbnails', MThumbnail[]> &
+ Use<'VideoBlacklist', MVideoBlacklistLight>
+
export type MVideoTag = MVideo &
Use<'Tags', MTag[]>