emby列表增加内存缓存
This commit is contained in:
@@ -6,6 +6,7 @@ import { getAuthInfoFromCookie } from '@/lib/auth';
|
||||
import { getConfig } from '@/lib/config';
|
||||
import { db } from '@/lib/db';
|
||||
import { EmbyClient } from '@/lib/emby.client';
|
||||
import { clearEmbyCache } from '@/lib/emby-cache';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
|
||||
@@ -176,6 +177,16 @@ export async function POST(request: NextRequest) {
|
||||
});
|
||||
}
|
||||
|
||||
if (action === 'clearCache') {
|
||||
// 清除缓存
|
||||
const result = clearEmbyCache();
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: `已清除 ${result.cleared} 条 Emby 缓存`,
|
||||
cleared: result.cleared,
|
||||
});
|
||||
}
|
||||
|
||||
return NextResponse.json({ error: '不支持的操作' }, { status: 400 });
|
||||
} catch (error) {
|
||||
console.error('Emby 配置保存失败:', error);
|
||||
|
||||
Reference in New Issue
Block a user