import * as Sequelize from 'sequelize'
-
-import { isVideoChannelNameValid, isVideoChannelDescriptionValid } from '../../helpers'
-
-import { addMethodsToModel, getSort } from '../utils'
-import {
- VideoChannelInstance,
- VideoChannelAttributes,
-
- VideoChannelMethods
-} from './video-channel-interface'
-import { sendDeleteVideoChannel } from '../../lib/activitypub/send-request'
+import { isVideoChannelDescriptionValid, isVideoChannelNameValid } from '../../helpers'
import { isVideoChannelUrlValid } from '../../helpers/custom-validators/video-channels'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
+import { sendDeleteVideoChannel } from '../../lib/activitypub/send/send-delete'
+
+import { addMethodsToModel, getSort } from '../utils'
+import { VideoChannelAttributes, VideoChannelInstance, VideoChannelMethods } from './video-channel-interface'
let VideoChannel: Sequelize.Model<VideoChannelInstance, VideoChannelAttributes>
let toFormattedJSON: VideoChannelMethods.ToFormattedJSON
let toActivityPubObject: VideoChannelMethods.ToActivityPubObject
let isOwned: VideoChannelMethods.IsOwned
let countByAccount: VideoChannelMethods.CountByAccount
-let listOwned: VideoChannelMethods.ListOwned
let listForApi: VideoChannelMethods.ListForApi
let listByAccount: VideoChannelMethods.ListByAccount
let loadByIdAndAccount: VideoChannelMethods.LoadByIdAndAccount
listForApi,
listByAccount,
- listOwned,
loadByIdAndAccount,
loadAndPopulateAccount,
loadByUUIDAndPopulateAccount,
return VideoChannel.count(query)
}
-listOwned = function () {
- const query = {
- where: {
- remote: false
- },
- include: [ VideoChannel['sequelize'].models.Account ]
- }
-
- return VideoChannel.findAll(query)
-}
-
listForApi = function (start: number, count: number, sort: string) {
const query = {
offset: start,