From b302c80dc0d9ba8eabef9ef6576efe36afc57584 Mon Sep 17 00:00:00 2001 From: Wicklow <123956049+wickloww@users.noreply.github.com> Date: Fri, 7 Apr 2023 08:09:54 +0000 Subject: feature/ability to disable video history by default (#5728) * draft: ability to disable video history by default * Update configuration and add tests * Updated code based on review comments * Add tests on registration and video quota * Remove required video quotas in query * Fix tests --- shared/models/server/custom-config.model.ts | 6 ++++++ shared/server-commands/server/config-command.ts | 5 +++++ shared/server-commands/users/users-command.ts | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'shared') diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 846bf6159..6ffe3a676 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts @@ -97,6 +97,11 @@ export interface CustomConfig { } user: { + history: { + videos: { + enabled: boolean + } + } videoQuota: number videoQuotaDaily: number } @@ -229,4 +234,5 @@ export interface CustomConfig { isDefaultSearch: boolean } } + } diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index eb6bb95a5..303fcab88 100644 --- a/shared/server-commands/server/config-command.ts +++ b/shared/server-commands/server/config-command.ts @@ -350,6 +350,11 @@ export class ConfigCommand extends AbstractCommand { enabled: true }, user: { + history: { + videos: { + enabled: true + } + }, videoQuota: 5242881, videoQuotaDaily: 318742 }, diff --git a/shared/server-commands/users/users-command.ts b/shared/server-commands/users/users-command.ts index 8a42fafc8..5b39d3488 100644 --- a/shared/server-commands/users/users-command.ts +++ b/shared/server-commands/users/users-command.ts @@ -165,8 +165,8 @@ export class UsersCommand extends AbstractCommand { username, adminFlags, password = 'password', - videoQuota = 42000000, - videoQuotaDaily = -1, + videoQuota, + videoQuotaDaily, role = UserRole.USER } = options -- cgit v1.2.3