aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-26 10:20:58 +0200
committerChocobozzz <me@florianbigard.com>2019-05-13 09:45:36 +0200
commita18f275d302bbd95443c258b8d92f6dfd8eb1653 (patch)
tree2cf4362ce6fd8580eca070c5ca74f33e1356a0c9 /server/models
parentc342726ad4ccbb90b8ff29f1cc1c89f9f7e8d98f (diff)
downloadPeerTube-a18f275d302bbd95443c258b8d92f6dfd8eb1653.tar.gz
PeerTube-a18f275d302bbd95443c258b8d92f6dfd8eb1653.tar.zst
PeerTube-a18f275d302bbd95443c258b8d92f6dfd8eb1653.zip
Fix thumbnail when listing my videos
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts16
1 files changed, 6 insertions, 10 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 4e6f602aa..c0a7892a4 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -1126,15 +1126,11 @@ export class VideoModel extends Model<VideoModel> {
1126 const countQuery = buildBaseQuery() 1126 const countQuery = buildBaseQuery()
1127 const findQuery = buildBaseQuery() 1127 const findQuery = buildBaseQuery()
1128 1128
1129 findQuery.include.push({ 1129 const findScopes = [
1130 model: ScheduleVideoUpdateModel, 1130 ScopeNames.WITH_SCHEDULED_UPDATE,
1131 required: false 1131 ScopeNames.WITH_BLACKLISTED,
1132 }) 1132 ScopeNames.WITH_THUMBNAILS
1133 1133 ]
1134 findQuery.include.push({
1135 model: VideoBlacklistModel,
1136 required: false
1137 })
1138 1134
1139 if (withFiles === true) { 1135 if (withFiles === true) {
1140 findQuery.include.push({ 1136 findQuery.include.push({
@@ -1145,7 +1141,7 @@ export class VideoModel extends Model<VideoModel> {
1145 1141
1146 return Promise.all([ 1142 return Promise.all([
1147 VideoModel.count(countQuery), 1143 VideoModel.count(countQuery),
1148 VideoModel.findAll(findQuery) 1144 VideoModel.scope(findScopes).findAll(findQuery)
1149 ]).then(([ count, rows ]) => { 1145 ]).then(([ count, rows ]) => {
1150 return { 1146 return {
1151 data: rows, 1147 data: rows,