Merge branch 'release/1.4.0' into develop
authorChocobozzz <me@florianbigard.com>
Thu, 5 Sep 2019 08:19:35 +0000 (10:19 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 5 Sep 2019 08:19:35 +0000 (10:19 +0200)
1  2 
client/src/app/+signup/+register/register.component.html
server/lib/schedulers/videos-redundancy-scheduler.ts
server/models/video/video-blacklist.ts

index e7440fe1e02fc04c3898c8bfeb4b757a494f9687,e4d647fef5b46e14999a2b2bb81e177e7841e70f..906e29aeddb3088d3aaf1d0518d0f8266adbae16
@@@ -7,15 -7,11 +7,15 @@@
    <my-signup-success *ngIf="signupDone" [message]="success"></my-signup-success>
    <div *ngIf="info" class="alert alert-info">{{ info }}</div>
  
 -  <div class="wrapper" *ngIf="!signupDone">
 -    <div>
 +  <div class="wrapper" [hidden]="signupDone">
 +    <div class="register-form">
        <my-custom-stepper linear *ngIf="!signupDone">
-         <cdk-step [stepControl]="formStepUser" i18n-label label="User information">
+         <cdk-step [stepControl]="formStepUser" i18n-label label="User">
 -          <my-register-step-user (formBuilt)="onUserFormBuilt($event)"></my-register-step-user>
 +          <my-register-step-user
 +            [hasCodeOfConduct]="!!aboutHtml.codeOfConduct"
 +            (formBuilt)="onUserFormBuilt($event)" (termsClick)="onTermsClick()" (codeOfConductClick)="onCodeOfConductClick()"
 +          >
 +          </my-register-step-user>
  
            <button i18n cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid">Next</button>
          </cdk-step>
index d326148d0779de8d411c716ec93d340f75341a95,5f4aad66e914bf40aac591fd1d5950a9b5d35f55..1e30f6ebc2b6ef3e1bce558b8d14434f384848a1
@@@ -261,9 -241,9 +261,9 @@@ export class VideosRedundancyScheduler 
    }
  
    private async purgeCacheIfNeeded (candidateToDuplicate: CandidateToDuplicate) {
-     while (this.isTooHeavy(candidateToDuplicate)) {
+     while (await this.isTooHeavy(candidateToDuplicate)) {
        const redundancy = candidateToDuplicate.redundancy
 -      const toDelete = await VideoRedundancyModel.loadOldestLocalThatAlreadyExpired(redundancy.strategy, redundancy.minLifetime)
 +      const toDelete = await VideoRedundancyModel.loadOldestLocalExpired(redundancy.strategy, redundancy.minLifetime)
        if (!toDelete) return
  
        await removeVideoRedundancy(toDelete)
index b4df6cd6a3707d15bc026bc962cd82c6e68f3441,cdb725e7ad82c4db8a96f24898c84231cc4117fb..533bfe1add0ba77d6e006f3bbabee7b1d8e5f0f1
@@@ -1,14 -1,12 +1,14 @@@
  import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'
- import { getSortOnModel, SortType, throwIfNotValid } from '../utils'
 -import { getBlacklistSort, getSort, SortType, throwIfNotValid } from '../utils'
 -import { ScopeNames as VideoModelScopeNames, VideoModel } from './video'
++import { getBlacklistSort, SortType, throwIfNotValid } from '../utils'
 +import { VideoModel } from './video'
  import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel'
  import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist'
  import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos'
  import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
- import { FindOptions } from 'sequelize'
+ import { FindOptions, literal } from 'sequelize'
  import { ThumbnailModel } from './thumbnail'
 +import * as Bluebird from 'bluebird'
 +import { MVideoBlacklist, MVideoBlacklistFormattable } from '@server/typings/models'
  
  @Table({
    tableName: 'videoBlacklist',