mirror of
https://github.com/ld3z/new-manga.git
synced 2026-11-09 21:13:46 -07:00
add better feed handling
This commit is contained in:
parent
b8499d90c6
commit
0daac66b26
4 changed files with 252 additions and 183 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Feed } from 'feed';
|
||||
import { getChaptersForSlugs, isValidLanguage } from "../../lib/api";
|
||||
import { getFeedMapping } from "../../lib/db";
|
||||
import { getFeedMapping, warmChapterCache } from "../../lib/db";
|
||||
import type { APIRoute } from "astro";
|
||||
|
||||
export const GET: APIRoute = async ({ params, request }) => {
|
||||
|
|
@ -22,6 +22,8 @@ export const GET: APIRoute = async ({ params, request }) => {
|
|||
return new Response("Invalid language", { status: 400 });
|
||||
}
|
||||
|
||||
await warmChapterCache(slugs, lang);
|
||||
|
||||
const chapters = await getChaptersForSlugs(slugs, lang);
|
||||
|
||||
if (chapters.length === 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue