From df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Mar 2019 10:58:44 +0100 Subject: Add playlist rest tests --- server/lib/user.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/lib/user.ts') 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' import { ActorModel } from '../models/activitypub/actor' import { UserNotificationSettingModel } from '../models/account/user-notification-setting' import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' +import { createWatchLaterPlaylist } from './video-playlist' -async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) { +async function createUserAccountAndChannelAndPlaylist (userToCreate: UserModel, validateUser = true) { const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { const userOptions = { transaction: t, @@ -38,7 +39,9 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse } const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) - return { user: userCreated, account: accountCreated, videoChannel } + const videoPlaylist = await createWatchLaterPlaylist(accountCreated, t) + + return { user: userCreated, account: accountCreated, videoChannel, videoPlaylist } }) const [ accountKeys, channelKeys ] = await Promise.all([ @@ -89,7 +92,7 @@ async function createApplicationActor (applicationId: number) { export { createApplicationActor, - createUserAccountAndChannel, + createUserAccountAndChannelAndPlaylist, createLocalAccountWithoutKeys } -- cgit v1.2.3