From 6aa541481390980f9c85d2e66514ba0e6ce77a35 Mon Sep 17 00:00:00 2001 From: LoveIsGrief Date: Tue, 24 Sep 2019 08:48:01 +0200 Subject: 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 --- server/models/account/user.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server/models/account') 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 { isNoInstanceConfigWarningModal, isUserAdminFlagsValid, isUserAutoPlayVideoValid, + isUserAutoPlayNextVideoValid, isUserBlockedReasonValid, isUserBlockedValid, isUserEmailVerifiedValid, @@ -160,6 +161,12 @@ export class UserModel extends Model { @Column autoPlayVideo: boolean + @AllowNull(false) + @Default(false) + @Is('UserAutoPlayNextVideo', value => throwIfNotValid(value, isUserAutoPlayNextVideoValid, 'auto play next video boolean')) + @Column + autoPlayNextVideo: boolean + @AllowNull(true) @Default(null) @Is('UserVideoLanguages', value => throwIfNotValid(value, isUserVideoLanguages, 'video languages')) @@ -597,6 +604,7 @@ export class UserModel extends Model { webTorrentEnabled: this.webTorrentEnabled, videosHistoryEnabled: this.videosHistoryEnabled, autoPlayVideo: this.autoPlayVideo, + autoPlayNextVideo: this.autoPlayNextVideo, videoLanguages: this.videoLanguages, role: this.role, -- cgit v1.2.3