diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-05 10:42:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-09 14:52:55 +0200 |
commit | b84d4c809f0b1c4b3f2029f56b81dbca37364f36 (patch) | |
tree | 1896405fa45c980eaf7860c838daa5500c10d50f /server/models | |
parent | 0f32d49915378178eff4ab954c71f17e06aa8e1a (diff) | |
download | PeerTube-b84d4c809f0b1c4b3f2029f56b81dbca37364f36.tar.gz PeerTube-b84d4c809f0b1c4b3f2029f56b81dbca37364f36.tar.zst PeerTube-b84d4c809f0b1c4b3f2029f56b81dbca37364f36.zip |
Fix video comments feed SQL query
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video-comment.ts | 5 | ||||
-rw-r--r-- | server/models/video/video.ts | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index ba09522cc..cf2a80d53 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -144,6 +144,11 @@ enum ScopeNames { | |||
144 | }, | 144 | }, |
145 | { | 145 | { |
146 | fields: [ 'accountId' ] | 146 | fields: [ 'accountId' ] |
147 | }, | ||
148 | { | ||
149 | fields: [ | ||
150 | { name: 'createdAt', order: 'DESC' } | ||
151 | ] | ||
147 | } | 152 | } |
148 | ] | 153 | ] |
149 | }) | 154 | }) |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 02a4c851c..344bfc929 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -23,7 +23,7 @@ import { | |||
23 | Table, | 23 | Table, |
24 | UpdatedAt | 24 | UpdatedAt |
25 | } from 'sequelize-typescript' | 25 | } from 'sequelize-typescript' |
26 | import { UserRight, VideoPrivacy, VideoState } from '../../../shared' | 26 | import { UserRight, VideoPrivacy, VideoState, ResultList } from '../../../shared' |
27 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' | 27 | import { VideoTorrentObject } from '../../../shared/models/activitypub/objects' |
28 | import { Video, VideoDetails } from '../../../shared/models/videos' | 28 | import { Video, VideoDetails } from '../../../shared/models/videos' |
29 | import { VideoFilter } from '../../../shared/models/videos/video-query.type' | 29 | import { VideoFilter } from '../../../shared/models/videos/video-query.type' |
@@ -1442,7 +1442,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1442 | private static async getAvailableForApi ( | 1442 | private static async getAvailableForApi ( |
1443 | options: BuildVideosQueryOptions, | 1443 | options: BuildVideosQueryOptions, |
1444 | countVideos = true | 1444 | countVideos = true |
1445 | ) { | 1445 | ): Promise<ResultList<VideoModel>> { |
1446 | function getCount () { | 1446 | function getCount () { |
1447 | if (countVideos !== true) return Promise.resolve(undefined) | 1447 | if (countVideos !== true) return Promise.resolve(undefined) |
1448 | 1448 | ||