-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,
// 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)
{
const data = {
- type: Sequelize.ENUM(values(JOB_CATEGORIES)),
+ type: Sequelize.ENUM('transcoding', 'activitypub-http'),
defaultValue: 'transcoding',
allowNull: false
}
})
for (const video of videos) {
- await shareVideoByServer(video, undefined)
+ await shareVideoByServerAndChannel(video, undefined)
}
}
}