Skip to content

Commit 38a418a

Browse files
committed
Remove ratings code
1 parent 6be2f96 commit 38a418a

File tree

6 files changed

+0
-227
lines changed

6 files changed

+0
-227
lines changed

src/app.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ import ExpressPromiseRouter from "express-promise-router";
4343
import { Server } from "http";
4444
import { youtubeApiProxy } from "./routes/youtubeApiProxy";
4545
import { getChapterNames } from "./routes/getChapterNames";
46-
import { postRating } from "./routes/ratings/postRating";
47-
import { getRating } from "./routes/ratings/getRating";
48-
import { postClearCache as ratingPostClearCache } from "./routes/ratings/postClearCache";
4946
import { getTopCategoryUsers } from "./routes/getTopCategoryUsers";
5047
import { addUserAsTempVIP } from "./routes/addUserAsTempVIP";
5148
import { addFeature } from "./routes/addFeature";
@@ -80,11 +77,9 @@ function setupRoutes(router: Router) {
8077
// Rate limit endpoint lists
8178
const voteEndpoints: RequestHandler[] = [voteOnSponsorTime];
8279
const viewEndpoints: RequestHandler[] = [viewedVideoSponsorTime];
83-
const postRateEndpoints: RequestHandler[] = [postRating];
8480
if (config.rateLimit) {
8581
if (config.rateLimit.vote) voteEndpoints.unshift(rateLimitMiddleware(config.rateLimit.vote, voteGetUserID));
8682
if (config.rateLimit.view) viewEndpoints.unshift(rateLimitMiddleware(config.rateLimit.view));
87-
if (config.rateLimit.rate) postRateEndpoints.unshift(rateLimitMiddleware(config.rateLimit.rate));
8883
}
8984

9085
//add the get function
@@ -199,12 +194,6 @@ function setupRoutes(router: Router) {
199194

200195
router.post("/api/feature", addFeature);
201196

202-
// ratings
203-
router.get("/api/ratings/rate/:prefix", getRating);
204-
router.get("/api/ratings/rate", getRating);
205-
router.post("/api/ratings/rate", postRateEndpoints);
206-
router.post("/api/ratings/clearCache", ratingPostClearCache);
207-
208197
if (config.postgres?.enabled) {
209198
router.get("/database", (req, res) => dumpDatabase(req, res, true));
210199
router.get("/database.json", (req, res) => dumpDatabase(req, res, false));

src/config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ addDefaults(config, {
6262
max: 10,
6363
statusCode: 200,
6464
message: "OK",
65-
},
66-
rate: {
67-
windowMs: 900000,
68-
max: 20,
69-
statusCode: 200,
70-
message: "Success",
7165
}
7266
},
7367
userCounterURL: null,

src/routes/ratings/getRating.ts

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/routes/ratings/postClearCache.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/routes/ratings/postRating.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/types/config.model.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export interface SBSConfig {
5252
rateLimit: {
5353
vote: RateLimitConfig;
5454
view: RateLimitConfig;
55-
rate: RateLimitConfig;
5655
};
5756
mysql?: any;
5857
privateMysql?: any;

0 commit comments

Comments
 (0)