X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-channel.ts;h=64130310d4db7ed47844812820f5072cc1d4b8b7;hb=74bb2cb8348d6794ed3a0e2ec94c8c9abdde82cf;hp=f8414d4a870758cfd20fdef109aff6a8af942dc0;hpb=20494f122186bb1bfd82f4c598c4744acea27b0c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index f8414d4a8..64130310d 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -1,24 +1,17 @@ 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 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 @@ -94,7 +87,6 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da listForApi, listByAccount, - listOwned, loadByIdAndAccount, loadAndPopulateAccount, loadByUUIDAndPopulateAccount, @@ -198,17 +190,6 @@ countByAccount = function (accountId: number) { 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,