}
function createDirectoriesIfNotExist () {
- const storages = CONFIG.STORAGE
+ const storage = CONFIG.STORAGE
const cacheDirectories = CACHE.DIRECTORIES
const tasks = []
- Object.keys(storages).forEach(key => {
- const dir = storages[key]
+ Object.keys(storage).forEach(key => {
+ const dir = storage[key]
tasks.push(mkdirpPromise(dir))
})
}
function createOAuthClientIfNotExist () {
- return clientsExist().then(exist => {
+ return clientsExist(db.OAuthClient).then(exist => {
// Nothing to do, clients already exist
if (exist === true) return undefined
}
function createOAuthAdminIfNotExist () {
- return usersExist().then(exist => {
+ return usersExist(db.User).then(exist => {
// Nothing to do, users already exist
if (exist === true) return undefined
username,
email,
password,
- role
+ role,
+ videoQuota: -1
}
return db.User.create(userData, createOptions).then(createdUser => {