From 7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Livet?= Date: Tue, 19 Dec 2017 10:45:49 +0100 Subject: Enh #106 : Add an autoPlayVideo user attribute (#159) Warning : I was not able to run the tests on my machine. It uses a different approach to handle databse connexion and didn't find where to configure it... - create a migration file to add a boolean column in user table - add autoPlayVideo attribute everywhere it is needed (both on client and server side) - add tests - add a way to configure this attribute in account-settings - use the attribute in video-watch component to actually autoplay or not the video --- server/controllers/api/users.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/controllers/api/users.ts') diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts index d6c0e67f9..995542604 100644 --- a/server/controllers/api/users.ts +++ b/server/controllers/api/users.ts @@ -134,6 +134,7 @@ async function createUser (req: express.Request) { password: body.password, email: body.email, displayNSFW: false, + autoPlayVideo: true, role: body.role, videoQuota: body.videoQuota }) @@ -162,6 +163,7 @@ async function registerUser (req: express.Request) { password: body.password, email: body.email, displayNSFW: false, + autoPlayVideo: true, role: UserRole.USER, videoQuota: CONFIG.USER.VIDEO_QUOTA }) @@ -219,6 +221,7 @@ async function updateMe (req: express.Request, res: express.Response, next: expr if (body.password !== undefined) user.password = body.password if (body.email !== undefined) user.email = body.email if (body.displayNSFW !== undefined) user.displayNSFW = body.displayNSFW + if (body.autoPlayVideo !== undefined) user.autoPlayVideo = body.autoPlayVideo await user.save() -- cgit v1.2.3