Skip to content

Commit 2683c61

Browse files
committed
add minUserIDLength config option
1 parent cff2325 commit 2683c61

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

ci.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@
7676
"clientSecret": "testClientSecret",
7777
"redirectUri": "http://127.0.0.1/fake/callback"
7878
},
79-
"minReputationToSubmitFiller": -1
79+
"minReputationToSubmitFiller": -1,
80+
"minUserIDLength": 0
8081
}

config.json.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@
6666
{
6767
"name": "vipUsers"
6868
}]
69-
}
69+
},
70+
"minUserIDLength": 30 // minimum length of UserID to be accepted
7071
}

src/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ addDefaults(config, {
166166
},
167167
gumroad: {
168168
productPermalinks: ["sponsorblock"]
169-
}
169+
},
170+
minUserIDLength: 30
170171
});
171172
loadFromEnv(config);
172173
migrate(config);

src/routes/voteOnSponsorTime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
325325
return { status: 400 };
326326
}
327327
// Ignore this vote, invalid
328-
if (paramUserID.length < 30 && config.mode !== "test") {
328+
if (paramUserID.length < config.minUserIDLength) {
329329
return { status: 200 };
330330
}
331331

src/types/config.model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ export interface SBSConfig {
9494
}
9595
gumroad: {
9696
productPermalinks: string[],
97-
}
97+
},
98+
minUserIDLength: number
9899
}
99100

100101
export interface WebhookConfig {

0 commit comments

Comments
 (0)