Skip to content

Commit 08ab7e8

Browse files
committed
Restrict changing chapters category
1 parent f103a02 commit 08ab7e8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/routes/voteOnSponsorTime.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,8 @@ async function categoryVote(UUID: SegmentUUID, userID: UserID, isVIP: boolean, i
221221
const segmentInfo = (await db.prepare("get", `SELECT "category", "actionType", "videoID", "hashedVideoID", "service", "userID", "locked" FROM "sponsorTimes" WHERE "UUID" = ?`,
222222
[UUID], { useReplica: true })) as {category: Category, actionType: ActionType, videoID: VideoID, hashedVideoID: VideoIDHash, service: Service, userID: UserID, locked: number};
223223

224-
if (segmentInfo.actionType === ActionType.Full) {
225-
return { status: 400, message: "Not allowed to change category of a full video segment" };
226-
}
227-
if (segmentInfo.actionType === ActionType.Poi || category === "poi_highlight") {
228-
return { status: 400, message: "Not allowed to change category for single point segments" };
224+
if (segmentInfo.actionType !== ActionType.Skip || category === "poi_highlight" || category === "chapter") {
225+
return { status: 400, message: "Not allowed to change category of non skip segments" };
229226
}
230227
if (!config.categoryList.includes(category)) {
231228
return { status: 400, message: "Category doesn't exist." };

0 commit comments

Comments
 (0)