X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Fuser.ts;h=ea017c338fbdd4f6d73b0bac60677028d0f62490;hb=8b9a525a180cc9f3a98c334cc052dcfc8f36dcd4;hp=34aafa1a7c586abc7930d471a5dcd78582b2a970;hpb=6d8c8ea73a774c3568e6d28a4cbebcf7979d5c2a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/user.ts b/server/models/account/user.ts index 34aafa1a7..ea017c338 100644 --- a/server/models/account/user.ts +++ b/server/models/account/user.ts @@ -1,6 +1,6 @@ import * as Sequelize from 'sequelize' import { - AfterDelete, + AfterDestroy, AfterUpdate, AllowNull, BeforeCreate, @@ -32,7 +32,8 @@ import { isUserUsernameValid, isUserVideoQuotaDailyValid, isUserVideoQuotaValid, - isUserWebTorrentEnabledValid + isUserWebTorrentEnabledValid, + isUserVideosHistoryEnabledValid } from '../../helpers/custom-validators/users' import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto' import { OAuthTokenModel } from '../oauth/oauth-token' @@ -114,6 +115,12 @@ export class UserModel extends Model { @Column webTorrentEnabled: boolean + @AllowNull(false) + @Default(true) + @Is('UserVideosHistoryEnabled', value => throwIfNotValid(value, isUserVideosHistoryEnabledValid, 'Videos history enabled')) + @Column + videosHistoryEnabled: boolean + @AllowNull(false) @Default(true) @Is('UserAutoPlayVideo', value => throwIfNotValid(value, isUserAutoPlayVideoValid, 'auto play video boolean')) @@ -179,7 +186,7 @@ export class UserModel extends Model { } @AfterUpdate - @AfterDelete + @AfterDestroy static removeTokenCache (instance: UserModel) { return clearCacheByUserId(instance.id) }