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/initializers/constants.ts | 7 +++++++ server/initializers/installer.ts | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'server/initializers') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 154a9cffe..59c30fdee 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -11,6 +11,7 @@ import { invert } from 'lodash' import { CronRepeatOptions, EveryRepeatOptions } from 'bull' import * as bytes from 'bytes' import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' +import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model' // Use a variable to reload the configuration if we need let config: IConfig = require('config') @@ -522,6 +523,11 @@ const VIDEO_PLAYLIST_PRIVACIES = { [VideoPlaylistPrivacy.PRIVATE]: 'Private' } +const VIDEO_PLAYLIST_TYPES = { + [VideoPlaylistType.REGULAR]: 'Regular', + [VideoPlaylistType.WATCH_LATER]: 'Watch later' +} + const MIMETYPES = { VIDEO: { MIMETYPE_EXT: buildVideoMimetypeExt(), @@ -778,6 +784,7 @@ export { STATIC_MAX_AGE, STATIC_PATHS, VIDEO_IMPORT_TIMEOUT, + VIDEO_PLAYLIST_TYPES, ACTIVITY_PUB, ACTIVITY_PUB_ACTOR_TYPES, THUMBNAILS_SIZE, diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts index 2b22e16fe..c669606f8 100644 --- a/server/initializers/installer.ts +++ b/server/initializers/installer.ts @@ -1,7 +1,7 @@ import * as passwordGenerator from 'password-generator' import { UserRole } from '../../shared' import { logger } from '../helpers/logger' -import { createApplicationActor, createUserAccountAndChannel } from '../lib/user' +import { createApplicationActor, createUserAccountAndChannelAndPlaylist } from '../lib/user' import { UserModel } from '../models/account/user' import { ApplicationModel } from '../models/application/application' import { OAuthClientModel } from '../models/oauth/oauth-client' @@ -141,7 +141,7 @@ async function createOAuthAdminIfNotExist () { } const user = new UserModel(userData) - await createUserAccountAndChannel(user, validatePassword) + await createUserAccountAndChannelAndPlaylist(user, validatePassword) logger.info('Username: ' + username) logger.info('User password: ' + password) } -- cgit v1.2.3