Skip to content

Commit ec41102

Browse files
committed
Better chapter name error and increase min size
1 parent 08ab7e8 commit ec41102

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/routes/postSkipSegments.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,14 @@ async function checkInvalidFields(videoID: VideoID, userID: UserID, hashedUserID
227227
}
228228

229229
if (typeof segmentPair.description !== "string"
230-
|| (segmentPair.actionType === ActionType.Chapter && segmentPair.description.length > 60 )
231230
|| (segmentPair.description.length !== 0 && segmentPair.actionType !== ActionType.Chapter)) {
232231
invalidFields.push("segment description");
233232
}
234233

234+
if (segmentPair.actionType === ActionType.Chapter && segmentPair.description.length > 200) {
235+
invalidFields.push("chapter name (too long)");
236+
}
237+
235238
const permission = await canSubmit(hashedUserID, segmentPair.category);
236239
if (!permission.canSubmit) {
237240
Logger.warn(`Rejecting submission due to lack of permissions for category ${segmentPair.category}: ${segmentPair.segment} ${hashedUserID} ${videoID} ${videoDurationParam} ${userAgent}`);

0 commit comments

Comments
 (0)