Fixed odd formatting on lock categories error

This commit is contained in:
Ajay Ramachandran
2021-07-27 12:59:35 -04:00
parent 5ca3cb18e4
commit 48aa6d6e05

View File

@@ -358,13 +358,16 @@ async function checkEachSegmentValid(userID: string, videoID: VideoID
if (!isVIP && lockIndex !== -1) { if (!isVIP && lockIndex !== -1) {
// TODO: Do something about the fradulent submission // 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}`); 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, return {
errorMessage: `New submissions are not allowed for the following category: \ pass: false,
'${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\ errorCode: 403,
${lockedCategoryList[lockIndex].reason?.length !== 0 ? `Lock reason: '${lockedCategoryList[lockIndex].reason}'` : ""}\n errorMessage:
${(segments[i].category === "sponsor" ? "Maybe the segment you are submitting is a different category that you have not enabled and is not a sponsor. "+ `New submissions are not allowed for the following category: ` +
"Categories that aren't sponsor, such as self-promotion can be enabled in the options.\n\n" : "")}\ `'${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` +
If you believe this is incorrect, please contact someone on discord.gg/SponsorBlock or matrix.to/#/+sponsor:ajay.app` `${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`
}; };
} }