Better chapter name error and increase min size

This commit is contained in:
Ajay
2022-09-04 22:36:26 -04:00
parent 08ab7e816d
commit ec41102f07

View File

@@ -227,11 +227,14 @@ async function checkInvalidFields(videoID: VideoID, userID: UserID, hashedUserID
}
if (typeof segmentPair.description !== "string"
|| (segmentPair.actionType === ActionType.Chapter && segmentPair.description.length > 60 )
|| (segmentPair.description.length !== 0 && segmentPair.actionType !== ActionType.Chapter)) {
invalidFields.push("segment description");
}
if (segmentPair.actionType === ActionType.Chapter && segmentPair.description.length > 200) {
invalidFields.push("chapter name (too long)");
}
const permission = await canSubmit(hashedUserID, segmentPair.category);
if (!permission.canSubmit) {
Logger.warn(`Rejecting submission due to lack of permissions for category ${segmentPair.category}: ${segmentPair.segment} ${hashedUserID} ${videoID} ${videoDurationParam} ${userAgent}`);