import { Validators } from '@angular/forms'
export const VIDEO_NAME = {
- VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(50) ],
+ VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ],
MESSAGES: {
'required': 'Video name is required.',
'minlength': 'Video name must be at least 3 characters long.',
- 'maxlength': 'Video name cannot be more than 50 characters long.'
+ 'maxlength': 'Video name cannot be more than 120 characters long.'
}
}
}
export const VIDEO_TAGS = {
- VALIDATORS: [ Validators.minLength(2), Validators.maxLength(10) ],
+ VALIDATORS: [ Validators.minLength(2), Validators.maxLength(30) ],
MESSAGES: {
'minlength': 'A tag should be more than 2 characters long.',
- 'maxlength': 'A tag should be less than 10 characters long.'
+ 'maxlength': 'A tag should be less than 30 characters long.'
}
}
<label class="label-tags">Tags</label> <span class="little-information">(press enter to add the tag)</span>
<tag-input
[ngModel]="tags" [validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
- formControlName="tags" maxItems="3" modelAsStrings="true"
+ formControlName="tags" maxItems="5" modelAsStrings="true"
></tag-input>
</div>
<label for="tags" class="label-tags">Tags</label> <span class="little-information">(press enter to add the tag)</span>
<tag-input
[ngModel]="tags" [validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
- formControlName="tags" maxItems="3" modelAsStrings="true"
+ formControlName="tags" maxItems="5" modelAsStrings="true"
></tag-input>
</div>
this.form.patchValue(this.video.toJSON())
}
}
+
REASON: { min: 2, max: 300 } // Length
},
VIDEO_CHANNELS: {
- NAME: { min: 3, max: 50 }, // Length
+ NAME: { min: 3, max: 120 }, // Length
DESCRIPTION: { min: 3, max: 250 } // Length
},
VIDEOS: {
- NAME: { min: 3, max: 50 }, // Length
+ NAME: { min: 3, max: 120 }, // Length
DESCRIPTION: { min: 3, max: 250 }, // Length
EXTNAME: [ '.mp4', '.ogv', '.webm' ],
INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2
DURATION: { min: 1, max: 7200 }, // Number
- TAGS: { min: 0, max: 3 }, // Number of total tags
- TAG: { min: 2, max: 10 }, // Length
+ TAGS: { min: 0, max: 5 }, // Number of total tags
+ TAG: { min: 2, max: 30 }, // Length
THUMBNAIL: { min: 2, max: 30 },
THUMBNAIL_DATA: { min: 0, max: 20000 }, // Bytes
VIEWS: { min: 0 },
it('Should fail with a long name', async function () {
const fields = {
name: 'hello tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
+ 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
+ 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
+ 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long',
description: 'super description'
}
it('Should fail with a long name', async function () {
const fields = {
name: 'hello tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
+ 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
+ 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
+ 'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' +
'oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long',
description: 'super description'
}
it('Should fail with a long name', async function () {
const fields = {
- name: 'My very very very very very very very very very very very very very very very very long name',
+ name: 'My very very very very very very very very very very very very very very very very very ' +
+ 'very very very very very very very very very very very very very very very very long long' +
+ 'very very very very very very very very very very very very very very very very long name',
category: 5,
licence: 1,
language: 6,
language: 6,
nsfw: false,
description: 'my super description',
- tags: [ 'tag1', 'tag2', 'tag3', 'tag4' ],
+ tags: [ 'tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6' ],
channelId
}
const attaches = {
language: 6,
nsfw: false,
description: 'my super description',
- tags: [ 'my_super_tag_too_long', 'tag1' ],
+ tags: [ 'my_super_tag_too_long_long_long_long_long_long', 'tag1' ],
channelId
}
const attaches = {
it('Should fail with a long name', async function () {
const fields = {
- name: 'My very very very very very very very very very very very very very very very very long name',
+ name: 'My very very very very very very very very very very very very very very very very very ' +
+ 'very very very very very very very very very very very very very very very very long long' +
+ 'very very very very very very very very very very very very very very very very long name',
category: 5,
licence: 2,
language: 6,
language: 6,
nsfw: false,
description: 'my super description',
- tags: [ 'tag1', 'tag2', 'tag3', 'tag4' ]
+ tags: [ 'tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6' ]
}
await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
})
language: 6,
nsfw: false,
description: 'my super description',
- tags: [ 'my_super_tag_too_long', 'tag1' ]
+ tags: [ 'my_super_tag_too_long_long_long_long', 'tag1' ]
}
await makePutBodyRequest({ url: server.url, path: path + videoId, token: server.accessToken, fields })
})