Improve SQL request for video AP request

pull/422/head
Chocobozzz 2018-03-27 14:10:48 +02:00
parent 1869c87535
commit e53f952eba
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 15 additions and 5 deletions

View File

@ -203,7 +203,7 @@ enum ScopeNames {
[ScopeNames.WITH_FILES]: {
include: [
{
model: () => VideoFileModel,
model: () => VideoFileModel.unscoped(),
required: true
}
]
@ -211,8 +211,7 @@ enum ScopeNames {
[ScopeNames.WITH_SHARES]: {
include: [
{
model: () => VideoShareModel,
include: [ () => ActorModel ]
model: () => VideoShareModel.unscoped()
}
]
},
@ -220,14 +219,25 @@ enum ScopeNames {
include: [
{
model: () => AccountVideoRateModel,
include: [ () => AccountModel ]
include: [
{
model: () => AccountModel.unscoped(),
required: true,
include: [
{
attributes: [ 'url' ],
model: () => ActorModel.unscoped()
}
]
}
]
}
]
},
[ScopeNames.WITH_COMMENTS]: {
include: [
{
model: () => VideoCommentModel
model: () => VideoCommentModel.unscoped()
}
]
}