diff options
author | LoveIsGrief <LoveIsGrief@users.noreply.github.com> | 2019-09-24 08:48:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-09-24 08:48:01 +0200 |
commit | 6aa541481390980f9c85d2e66514ba0e6ce77a35 (patch) | |
tree | 7b2e934647a732645c69e5d05e4b18152b50a6b8 /server/models | |
parent | 32d7f2b754b8d20bf44ae2121c79570cbff973c3 (diff) | |
download | PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.gz PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.tar.zst PeerTube-6aa541481390980f9c85d2e66514ba0e6ce77a35.zip |
Autoplay next recommended video (#2137)
* Start working on autoplay of next video
* Ignore changes made by gitpod
* Apply changes from PR#1370
* Correct the spelling of recommendations
* Fix linting errors
* Move boolean check to existing onEnded handler
* Pick a random video until the recommendations are improved
* Add simple tests for autoPlayNextVideo
* Fix lint
...again
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/user.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 451e1fd6b..38c6d474a 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts | |||
@@ -25,6 +25,7 @@ import { | |||
25 | isNoInstanceConfigWarningModal, | 25 | isNoInstanceConfigWarningModal, |
26 | isUserAdminFlagsValid, | 26 | isUserAdminFlagsValid, |
27 | isUserAutoPlayVideoValid, | 27 | isUserAutoPlayVideoValid, |
28 | isUserAutoPlayNextVideoValid, | ||
28 | isUserBlockedReasonValid, | 29 | isUserBlockedReasonValid, |
29 | isUserBlockedValid, | 30 | isUserBlockedValid, |
30 | isUserEmailVerifiedValid, | 31 | isUserEmailVerifiedValid, |
@@ -160,6 +161,12 @@ export class UserModel extends Model<UserModel> { | |||
160 | @Column | 161 | @Column |
161 | autoPlayVideo: boolean | 162 | autoPlayVideo: boolean |
162 | 163 | ||
164 | @AllowNull(false) | ||
165 | @Default(false) | ||
166 | @Is('UserAutoPlayNextVideo', value => throwIfNotValid(value, isUserAutoPlayNextVideoValid, 'auto play next video boolean')) | ||
167 | @Column | ||
168 | autoPlayNextVideo: boolean | ||
169 | |||
163 | @AllowNull(true) | 170 | @AllowNull(true) |
164 | @Default(null) | 171 | @Default(null) |
165 | @Is('UserVideoLanguages', value => throwIfNotValid(value, isUserVideoLanguages, 'video languages')) | 172 | @Is('UserVideoLanguages', value => throwIfNotValid(value, isUserVideoLanguages, 'video languages')) |
@@ -597,6 +604,7 @@ export class UserModel extends Model<UserModel> { | |||
597 | webTorrentEnabled: this.webTorrentEnabled, | 604 | webTorrentEnabled: this.webTorrentEnabled, |
598 | videosHistoryEnabled: this.videosHistoryEnabled, | 605 | videosHistoryEnabled: this.videosHistoryEnabled, |
599 | autoPlayVideo: this.autoPlayVideo, | 606 | autoPlayVideo: this.autoPlayVideo, |
607 | autoPlayNextVideo: this.autoPlayNextVideo, | ||
600 | videoLanguages: this.videoLanguages, | 608 | videoLanguages: this.videoLanguages, |
601 | 609 | ||
602 | role: this.role, | 610 | role: this.role, |