From 48aa6d6e05ef5577ac2d70443ec1f571c5eedd96 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Tue, 27 Jul 2021 12:59:35 -0400 Subject: [PATCH] Fixed odd formatting on lock categories error --- src/routes/postSkipSegments.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index 268c776..74634f5 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -358,13 +358,16 @@ async function checkEachSegmentValid(userID: string, videoID: VideoID if (!isVIP && lockIndex !== -1) { // TODO: Do something about the fradulent submission Logger.warn(`Caught a submission for a locked category. userID: '${userID}', videoID: '${videoID}', category: '${segments[i].category}', times: ${segments[i].segment}`); - return { pass: false, errorCode: 403, - errorMessage: `New submissions are not allowed for the following category: \ - '${segments[i].category}'. A moderator has decided that no new segments are needed and that all current segments of this category are timed perfectly.\n\n\ - ${lockedCategoryList[lockIndex].reason?.length !== 0 ? `Lock reason: '${lockedCategoryList[lockIndex].reason}'` : ""}\n - ${(segments[i].category === "sponsor" ? "Maybe the segment you are submitting is a different category that you have not enabled and is not a sponsor. "+ - "Categories that aren't sponsor, such as self-promotion can be enabled in the options.\n\n" : "")}\ - If you believe this is incorrect, please contact someone on discord.gg/SponsorBlock or matrix.to/#/+sponsor:ajay.app` + return { + pass: false, + errorCode: 403, + errorMessage: + `New submissions are not allowed for the following category: ` + + `'${segments[i].category}'. A moderator has decided that no new segments are needed and that all current segments of this category are timed perfectly.\n\n` + + `${lockedCategoryList[lockIndex].reason?.length !== 0 ? `Lock reason: '${lockedCategoryList[lockIndex].reason}'` : ""}\n` + + `${(segments[i].category === "sponsor" ? "Maybe the segment you are submitting is a different category that you have not enabled and is not a sponsor. " + + "Categories that aren't sponsor, such as self-promotion can be enabled in the options.\n" : "")}` + + `\nIf you believe this is incorrect, please contact someone on discord.gg/SponsorBlock or matrix.to/#/+sponsor:ajay.app` }; }