mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-23 03:04:43 +08:00
fix: add await
This commit is contained in:
@@ -27,7 +27,7 @@ export async function GET(request: Request) {
|
||||
}
|
||||
|
||||
const result = await getDetailFromApi(apiSite, id);
|
||||
const cacheTime = getCacheTime();
|
||||
const cacheTime = await getCacheTime();
|
||||
|
||||
return NextResponse.json(result, {
|
||||
headers: {
|
||||
|
||||
@@ -108,7 +108,7 @@ export async function GET(request: Request) {
|
||||
list: list,
|
||||
};
|
||||
|
||||
const cacheTime = getCacheTime();
|
||||
const cacheTime = await getCacheTime();
|
||||
return NextResponse.json(response, {
|
||||
headers: {
|
||||
'Cache-Control': `public, max-age=${cacheTime}`,
|
||||
@@ -180,7 +180,7 @@ function handleTop250(pageStart: number) {
|
||||
list: movies,
|
||||
};
|
||||
|
||||
const cacheTime = getCacheTime();
|
||||
const cacheTime = await getCacheTime();
|
||||
return NextResponse.json(apiResponse, {
|
||||
headers: {
|
||||
'Cache-Control': `public, max-age=${cacheTime}`,
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function GET(request: Request) {
|
||||
const resourceId = searchParams.get('resourceId');
|
||||
|
||||
if (!query || !resourceId) {
|
||||
const cacheTime = getCacheTime();
|
||||
const cacheTime = await getCacheTime();
|
||||
return NextResponse.json(
|
||||
{ result: null, error: '缺少必要参数: q 或 resourceId' },
|
||||
{
|
||||
@@ -40,7 +40,7 @@ export async function GET(request: Request) {
|
||||
|
||||
const results = await searchFromApi(targetSite, query);
|
||||
const result = results.filter((r) => r.title === query);
|
||||
const cacheTime = getCacheTime();
|
||||
const cacheTime = await getCacheTime();
|
||||
|
||||
if (result.length === 0) {
|
||||
return NextResponse.json(
|
||||
|
||||
@@ -7,8 +7,8 @@ export const runtime = 'edge';
|
||||
// OrionTV 兼容接口
|
||||
export async function GET() {
|
||||
try {
|
||||
const apiSites = getAvailableApiSites();
|
||||
const cacheTime = getCacheTime();
|
||||
const apiSites = await getAvailableApiSites();
|
||||
const cacheTime = await getCacheTime();
|
||||
|
||||
return NextResponse.json(apiSites, {
|
||||
headers: {
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function GET(request: Request) {
|
||||
try {
|
||||
const results = await Promise.all(searchPromises);
|
||||
const flattenedResults = results.flat();
|
||||
const cacheTime = getCacheTime();
|
||||
const cacheTime = await getCacheTime();
|
||||
|
||||
return NextResponse.json(
|
||||
{ results: flattenedResults },
|
||||
|
||||
Reference in New Issue
Block a user