Table,
UpdatedAt
} from 'sequelize-typescript'
+import { exists } from '@server/helpers/custom-validators/misc'
import { getServerActor } from '@server/models/application/application'
import { MAccount, MAccountId, MUserAccountId } from '@server/types/models'
import { VideoPrivacy } from '@shared/models'
count: number
sort: string
+ onLocalVideo?: boolean
isLocal?: boolean
search?: string
searchAccount?: string
searchVideo?: string
}) {
- const { start, count, sort, isLocal, search, searchAccount, searchVideo } = parameters
+ const { start, count, sort, isLocal, search, searchAccount, searchVideo, onLocalVideo } = parameters
const where: WhereOptions = {
deletedAt: null
Object.assign(whereVideo, searchAttribute(searchVideo, 'name'))
}
+ if (exists(onLocalVideo)) {
+ Object.assign(whereVideo, { remote: !onLocalVideo })
+ }
+
const getQuery = (forCount: boolean) => {
return {
offset: start,