]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/migrations/0100-activitypub.ts
Add new name/terms/description config options
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0100-activitypub.ts
index fb42e1d57fd3c0d9d93e04bf9f93bb32fded3653..a7ebd804cd51e82447c2d5298b8378c9faeab7ec 100644 (file)
@@ -1,11 +1,10 @@
-import { values } from 'lodash'
 import * as Sequelize from 'sequelize'
 import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto'
-import { shareVideoByServer } from '../../lib/activitypub/share'
+import { shareVideoByServerAndChannel } from '../../lib/activitypub/share'
 import { getVideoActivityPubUrl, getVideoChannelActivityPubUrl } from '../../lib/activitypub/url'
 import { createLocalAccountWithoutKeys } from '../../lib/user'
 import { ApplicationModel } from '../../models/application/application'
-import { JOB_CATEGORIES, SERVER_ACCOUNT_NAME } from '../constants'
+import { SERVER_ACTOR_NAME } from '../constants'
 
 async function up (utils: {
   transaction: Sequelize.Transaction,
@@ -66,7 +65,7 @@ async function up (utils: {
   // Create application account
   {
     const applicationInstance = await ApplicationModel.findOne()
-    const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined)
+    const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACTOR_NAME, null, applicationInstance.id, undefined)
 
     const { publicKey, privateKey } = await createPrivateAndPublicKeys()
     accountCreated.set('publicKey', publicKey)
@@ -161,7 +160,7 @@ async function up (utils: {
 
   {
     const data = {
-      type: Sequelize.ENUM(values(JOB_CATEGORIES)),
+      type: Sequelize.ENUM('transcoding', 'activitypub-http'),
       defaultValue: 'transcoding',
       allowNull: false
     }
@@ -197,7 +196,7 @@ async function up (utils: {
     })
 
     for (const video of videos) {
-      await shareVideoByServer(video, undefined)
+      await shareVideoByServerAndChannel(video, undefined)
     }
   }
 }