]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-channel.ts
Add activitypub migration script
[github/Chocobozzz/PeerTube.git] / server / models / video / video-channel.ts
index f8414d4a870758cfd20fdef109aff6a8af942dc0..64130310d4db7ed47844812820f5072cc1d4b8b7 100644 (file)
@@ -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<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
@@ -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,