diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-25 11:17:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-25 11:18:11 +0100 |
commit | d7df188f23bb3c4773ac26e6fa8b3d82b1229e6d (patch) | |
tree | 887f4268a16d685f5da74898575d1ecff3fd1ff8 /server/models/account/user.ts | |
parent | 24d3352ce4b48bc9ff15e8c0af0c93df6d903e5e (diff) | |
download | PeerTube-d7df188f23bb3c4773ac26e6fa8b3d82b1229e6d.tar.gz PeerTube-d7df188f23bb3c4773ac26e6fa8b3d82b1229e6d.tar.zst PeerTube-d7df188f23bb3c4773ac26e6fa8b3d82b1229e6d.zip |
Fix separate SQL query for video get
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r-- | server/models/account/user.ts | 5 |
1 files changed, 3 insertions, 2 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' |
33 | import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' | 34 | import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' |
34 | import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models' | 35 | import { 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()) { |