X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=server%2Finitializers%2Fmigrations%2F0100-activitypub.ts;h=a7ebd804cd51e82447c2d5298b8378c9faeab7ec;hb=a10fc78bb0e00e98c8f59edc16cd323b9c8b0615;hp=fb42e1d57fd3c0d9d93e04bf9f93bb32fded3653;hpb=3fd3ab2d34d512b160a5e6084d7609be7b4f4452;p=oweals%2Fpeertube.git diff --git a/server/initializers/migrations/0100-activitypub.ts b/server/initializers/migrations/0100-activitypub.ts index fb42e1d57..a7ebd804c 100644 --- a/server/initializers/migrations/0100-activitypub.ts +++ b/server/initializers/migrations/0100-activitypub.ts @@ -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) } } }