]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/installer.ts
Add server migrations
[github/Chocobozzz/PeerTube.git] / server / initializers / installer.ts
index 2b22e16fe5f9d50c4986cf6c0ee5f4e372e4db3f..349d7afb7a7f967798b744034836d1425e082870 100644 (file)
@@ -1,12 +1,12 @@
 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'
 import { applicationExist, clientsExist, usersExist } from './checker-after-init'
-import { CACHE, CONFIG, HLS_PLAYLIST_DIRECTORY, LAST_MIGRATION_VERSION } from './constants'
+import { CACHE, CONFIG, HLS_STREAMING_PLAYLIST_DIRECTORY, LAST_MIGRATION_VERSION } from './constants'
 import { sequelizeTypescript } from './database'
 import { remove, ensureDir } from 'fs-extra'
 
@@ -74,7 +74,7 @@ function createDirectoriesIfNotExist () {
   }
 
   // Playlist directories
-  tasks.push(ensureDir(HLS_PLAYLIST_DIRECTORY))
+  tasks.push(ensureDir(HLS_STREAMING_PLAYLIST_DIRECTORY))
 
   return Promise.all(tasks)
 }
@@ -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)
 }