X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fuser.ts;h=f4ffae0e4178fa088d2e98fb3428d64189101977;hb=ce6b3765a2d31b9b90b7a1435e7180b91cba57b3;hp=ea755f4beab4dee1a92bb863224a9939126ab492;hpb=ab4b8974997777373a6032073f9c1aaf33ba9931;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/user.ts b/server/lib/user.ts index ea755f4be..f4ffae0e4 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts @@ -64,8 +64,8 @@ function buildUser (options: { emailVerified, adminFlags, - videoQuota: videoQuota, - videoQuotaDaily: videoQuotaDaily, + videoQuota, + videoQuotaDaily, pluginAuth }) @@ -147,7 +147,7 @@ async function createApplicationActor (applicationId: number) { const accountCreated = await createLocalAccountWithoutKeys({ name: SERVER_ACTOR_NAME, userId: null, - applicationId: applicationId, + applicationId, t: undefined, type: 'Application' }) @@ -173,7 +173,8 @@ async function getOriginalVideoFileTotalFromUser (user: MUserId) { // Don't use sequelize because we need to use a sub query const query = UserModel.generateUserQuotaBaseSQL({ withSelect: true, - whereUserId: '$userId' + whereUserId: '$userId', + daily: false }) const base = await UserModel.getTotalRawQuery(query, user.id) @@ -187,7 +188,7 @@ async function getOriginalVideoFileTotalDailyFromUser (user: MUserId) { const query = UserModel.generateUserQuotaBaseSQL({ withSelect: true, whereUserId: '$userId', - where: '"video"."createdAt" > now() - interval \'24 hours\'' + daily: true }) const base = await UserModel.getTotalRawQuery(query, user.id) @@ -252,7 +253,8 @@ function createDefaultUserNotificationSettings (user: MUserId, t: Transaction | abuseStateChange: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, autoInstanceFollowing: UserNotificationSettingValue.WEB, newPeerTubeVersion: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL, - newPluginVersion: UserNotificationSettingValue.WEB + newPluginVersion: UserNotificationSettingValue.WEB, + myVideoStudioEditionFinished: UserNotificationSettingValue.WEB } return UserNotificationSettingModel.create(values, { transaction: t })