mirror of https://github.com/Chocobozzz/PeerTube
Fix video comments feed SQL query
parent
0f32d49915
commit
b84d4c809f
|
@ -144,6 +144,11 @@ enum ScopeNames {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fields: [ 'accountId' ]
|
fields: [ 'accountId' ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fields: [
|
||||||
|
{ name: 'createdAt', order: 'DESC' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {
|
||||||
Table,
|
Table,
|
||||||
UpdatedAt
|
UpdatedAt
|
||||||
} from 'sequelize-typescript'
|
} from 'sequelize-typescript'
|
||||||
import { UserRight, VideoPrivacy, VideoState } from '../../../shared'
|
import { UserRight, VideoPrivacy, VideoState, ResultList } from '../../../shared'
|
||||||
import { VideoTorrentObject } from '../../../shared/models/activitypub/objects'
|
import { VideoTorrentObject } from '../../../shared/models/activitypub/objects'
|
||||||
import { Video, VideoDetails } from '../../../shared/models/videos'
|
import { Video, VideoDetails } from '../../../shared/models/videos'
|
||||||
import { VideoFilter } from '../../../shared/models/videos/video-query.type'
|
import { VideoFilter } from '../../../shared/models/videos/video-query.type'
|
||||||
|
@ -1442,7 +1442,7 @@ export class VideoModel extends Model<VideoModel> {
|
||||||
private static async getAvailableForApi (
|
private static async getAvailableForApi (
|
||||||
options: BuildVideosQueryOptions,
|
options: BuildVideosQueryOptions,
|
||||||
countVideos = true
|
countVideos = true
|
||||||
) {
|
): Promise<ResultList<VideoModel>> {
|
||||||
function getCount () {
|
function getCount () {
|
||||||
if (countVideos !== true) return Promise.resolve(undefined)
|
if (countVideos !== true) return Promise.resolve(undefined)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue