fix: add await

This commit is contained in:
shinya
2025-07-14 20:53:40 +08:00
parent 446bb0e9f0
commit c2ebf5758e
5 changed files with 8 additions and 8 deletions

View File

@@ -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: {

View File

@@ -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}`,

View File

@@ -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(

View File

@@ -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: {

View File

@@ -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 },