aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r--server/lib/user.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts
index a39ef6c3d..02a84f15b 100644
--- a/server/lib/user.ts
+++ b/server/lib/user.ts
@@ -11,8 +11,9 @@ import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model'
11import { ActorModel } from '../models/activitypub/actor' 11import { ActorModel } from '../models/activitypub/actor'
12import { UserNotificationSettingModel } from '../models/account/user-notification-setting' 12import { UserNotificationSettingModel } from '../models/account/user-notification-setting'
13import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' 13import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users'
14import { createWatchLaterPlaylist } from './video-playlist'
14 15
15async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) { 16async function createUserAccountAndChannelAndPlaylist (userToCreate: UserModel, validateUser = true) {
16 const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { 17 const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => {
17 const userOptions = { 18 const userOptions = {
18 transaction: t, 19 transaction: t,
@@ -38,7 +39,9 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
38 } 39 }
39 const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) 40 const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t)
40 41
41 return { user: userCreated, account: accountCreated, videoChannel } 42 const videoPlaylist = await createWatchLaterPlaylist(accountCreated, t)
43
44 return { user: userCreated, account: accountCreated, videoChannel, videoPlaylist }
42 }) 45 })
43 46
44 const [ accountKeys, channelKeys ] = await Promise.all([ 47 const [ accountKeys, channelKeys ] = await Promise.all([
@@ -89,7 +92,7 @@ async function createApplicationActor (applicationId: number) {
89 92
90export { 93export {
91 createApplicationActor, 94 createApplicationActor,
92 createUserAccountAndChannel, 95 createUserAccountAndChannelAndPlaylist,
93 createLocalAccountWithoutKeys 96 createLocalAccountWithoutKeys
94} 97}
95 98