feat: Add new endpoints and enhance filter — v2.2.0

New Endpoints (4 new routes):
- GET /api/upcoming — upcoming anime releases from homepage
- GET /api/top-rankings?sort=top|newest — ranked anime with sort modes
- GET /api/recently-updated?tab=all|dub|sub — filtered recent updates
- GET /api/completed — finished anime series from homepage

Enhanced Filter (/api/filter):
- Added source parameter (18 source material types)
- Added epMin/epMax for episode range filtering
- Added excludeWatchlist parameter for logged-in users
- Added season parameter (spring/summer/fall/winter)

New Config IDs:
- SOURCE_IDS: 18 source material type mappings
- SEASON_IDS: 4 broadcast season mappings
- EXTENDED_TYPE_IDS: Added tv-short and tv-special types

Total endpoints: 34 (was 30)
OpenAPI spec updated with new endpoints
CHANGELOG.md updated with comprehensive change history
This commit is contained in:
Shinei Nouzen
2026-07-28 19:45:25 +05:30
parent a8f1917ce7
commit fd29b02158
12 changed files with 751 additions and 9 deletions
+61 -1
View File
@@ -42,6 +42,10 @@ import { getTrendingSidebar } from "../controllers/trendingSidebar.controller.js
import { getSeasons } from "../controllers/seasons.controller.js";
import { getWatchOrder } from "../controllers/watchOrder.controller.js";
import { getDownloadLinks } from "../controllers/download.controller.js";
import { getUpcomingAnime } from "../controllers/upcomingAnime.controller.js";
import { getTopAnimeRankings } from "../controllers/topAnimeRankings.controller.js";
import { getRecentlyUpdatedTabs } from "../controllers/recentlyUpdatedTabs.controller.js";
import { getCompletedAnime } from "../controllers/completedAnime.controller.js";
import { categoryRoutes } from "./category.route.js";
import { getMirrorStatus, resetMirrorCache } from "../helper/mirror.helper.js";
@@ -328,6 +332,58 @@ app.use((req, res, next) => {
}
});
// ══════════════════════════════════════════════════════════════
// UPCOMING ANIME
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Upcoming anime releases ----
app.get("/api/upcoming", async (req, res, next) => {
try {
await getUpcomingAnime(req, res, next);
} catch (error) {
jsonError(res, error.message);
}
});
// ══════════════════════════════════════════════════════════════
// TOP ANIME RANKINGS
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Top anime rankings with sort (top/newest) ----
app.get("/api/top-rankings", async (req, res, next) => {
try {
await getTopAnimeRankings(req, res, next);
} catch (error) {
jsonError(res, error.message);
}
});
// ══════════════════════════════════════════════════════════════
// RECENTLY UPDATED (TAB FILTERED)
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Recently updated anime with tab filter (all/dub/sub) ----
app.get("/api/recently-updated", async (req, res, next) => {
try {
await getRecentlyUpdatedTabs(req, res, next);
} catch (error) {
jsonError(res, error.message);
}
});
// ══════════════════════════════════════════════════════════════
// COMPLETED ANIME
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Completed anime series ----
app.get("/api/completed", async (req, res, next) => {
try {
await getCompletedAnime(req, res, next);
} catch (error) {
jsonError(res, error.message);
}
});
// ══════════════════════════════════════════════════════════════
// SEASONS & WATCH ORDER
// ══════════════════════════════════════════════════════════════
@@ -418,7 +474,7 @@ app.get("/api/stats", (req, res) => {
ttl: "5 minutes",
description: "Map-based cache with TTL expiration",
},
endpoints: 30,
endpoints: 34,
timestamp: new Date().toISOString(),
},
});
@@ -491,6 +547,10 @@ app.get("/api/openapi", (req, res) => {
"/watch-order/{id}": { get: { summary: "Watch order", tags: ["Anime"] } },
"/az-list/{letter}": { get: { summary: "A-Z listing", tags: ["Discovery"] } },
"/suggestions": { get: { summary: "Anime suggestions", tags: ["Search"] } },
"/upcoming": { get: { summary: "Upcoming anime", tags: ["Discovery"] } },
"/top-rankings": { get: { summary: "Top anime rankings (top/newest)", tags: ["Rankings"] } },
"/recently-updated": { get: { summary: "Recently updated (all/dub/sub tabs)", tags: ["Releases"] } },
"/completed": { get: { summary: "Completed anime series", tags: ["Rankings"] } },
},
tags: [
{ name: "Home", description: "Homepage data" },