aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users
diff options
context:
space:
mode:
authorAndréas Livet <andreas.livet@gmail.com>2017-12-19 10:45:49 +0100
committerChocobozzz <me@florianbigard.com>2017-12-19 10:45:49 +0100
commit7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd (patch)
tree56116e7e9f8467b78ed6dfc81827288915d31c8c /client/src/app/shared/users
parent228077efd73485a2832bb6211c9fa923158c2112 (diff)
downloadPeerTube-7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd.tar.gz
PeerTube-7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd.tar.zst
PeerTube-7efe153b0bc23e596d5019b9fb3e3e32b6cfeccd.zip
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
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r--client/src/app/shared/users/user.model.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index b4d13f37c..7a962ae3e 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -8,6 +8,7 @@ export type UserConstructorHash = {
8 role: UserRole, 8 role: UserRole,
9 videoQuota?: number, 9 videoQuota?: number,
10 displayNSFW?: boolean, 10 displayNSFW?: boolean,
11 autoPlayVideo?: boolean,
11 createdAt?: Date, 12 createdAt?: Date,
12 account?: Account, 13 account?: Account,
13 videoChannels?: VideoChannel[] 14 videoChannels?: VideoChannel[]
@@ -18,6 +19,7 @@ export class User implements UserServerModel {
18 email: string 19 email: string
19 role: UserRole 20 role: UserRole
20 displayNSFW: boolean 21 displayNSFW: boolean
22 autoPlayVideo: boolean
21 videoQuota: number 23 videoQuota: number
22 account: Account 24 account: Account
23 videoChannels: VideoChannel[] 25 videoChannels: VideoChannel[]
@@ -42,6 +44,10 @@ export class User implements UserServerModel {
42 this.displayNSFW = hash.displayNSFW 44 this.displayNSFW = hash.displayNSFW
43 } 45 }
44 46
47 if (hash.autoPlayVideo !== undefined) {
48 this.autoPlayVideo = hash.autoPlayVideo
49 }
50
45 if (hash.createdAt !== undefined) { 51 if (hash.createdAt !== undefined) {
46 this.createdAt = hash.createdAt 52 this.createdAt = hash.createdAt
47 } 53 }