aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/account/user.ts5
-rw-r--r--server/models/video/video.ts5
2 files changed, 6 insertions, 4 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 534898f96..0834ecfa5 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -28,7 +28,8 @@ import {
28 MUserFormattable, 28 MUserFormattable,
29 MUserNotifSettingChannelDefault, 29 MUserNotifSettingChannelDefault,
30 MUserWithNotificationSetting, 30 MUserWithNotificationSetting,
31 MVideoFullLight 31 MVideoFullLight,
32 MVideoWithRights
32} from '@server/types/models' 33} from '@server/types/models'
33import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' 34import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users'
34import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models' 35import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models'
@@ -819,7 +820,7 @@ export class UserModel extends Model {
819 .then(u => u.map(u => u.username)) 820 .then(u => u.map(u => u.username))
820 } 821 }
821 822
822 canGetVideo (video: MVideoFullLight) { 823 canGetVideo (video: MVideoWithRights) {
823 const videoUserId = video.VideoChannel.Account.userId 824 const videoUserId = video.VideoChannel.Account.userId
824 825
825 if (video.isBlacklisted()) { 826 if (video.isBlacklisted()) {
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 48d4ba47a..8894843e0 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -356,6 +356,7 @@ export type AvailableForListIDsOptions = {
356 include: [ 356 include: [
357 { 357 {
358 model: VideoFileModel, 358 model: VideoFileModel,
359 separate: true,
359 required: false, 360 required: false,
360 include: subInclude 361 include: subInclude
361 } 362 }
@@ -383,6 +384,7 @@ export type AvailableForListIDsOptions = {
383 { 384 {
384 model: VideoStreamingPlaylistModel.unscoped(), 385 model: VideoStreamingPlaylistModel.unscoped(),
385 required: false, 386 required: false,
387 separate: true,
386 include: subInclude 388 include: subInclude
387 } 389 }
388 ] 390 ]
@@ -1312,8 +1314,7 @@ export class VideoModel extends Model {
1312 1314
1313 return VideoModel.scope([ 1315 return VideoModel.scope([
1314 ScopeNames.WITH_BLACKLISTED, 1316 ScopeNames.WITH_BLACKLISTED,
1315 ScopeNames.WITH_USER_ID, 1317 ScopeNames.WITH_USER_ID
1316 ScopeNames.WITH_THUMBNAILS
1317 ]).findOne(options) 1318 ]).findOne(options)
1318 } 1319 }
1319 1320