emby test2
This commit is contained in:
@@ -3,11 +3,17 @@ import { NextResponse } from 'next/server';
|
||||
import { embyManager } from '@/lib/emby-manager';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
export const dynamic = 'force-dynamic'; // 禁用缓存
|
||||
|
||||
/**
|
||||
* 获取所有启用的Emby源列表
|
||||
*/
|
||||
export async function GET() {
|
||||
console.log('=================================');
|
||||
console.log('[Emby Sources API] !!!!! 路由被调用了 !!!!!');
|
||||
console.log('[Emby Sources API] 时间戳:', new Date().toISOString());
|
||||
console.log('=================================');
|
||||
|
||||
try {
|
||||
console.log('[Emby Sources API] 开始获取Emby源列表');
|
||||
const sources = await embyManager.getEnabledSources();
|
||||
|
||||
@@ -144,6 +144,12 @@ class EmbyManager {
|
||||
console.log('[EmbyManager] getEnabledSources 被调用');
|
||||
const sources = await this.getSources();
|
||||
console.log('[EmbyManager] 获取到所有源:', sources.length, '个');
|
||||
|
||||
// 详细打印每个源的 enabled 字段
|
||||
sources.forEach((s, index) => {
|
||||
console.log(`[EmbyManager] 源 ${index}: key=${s.key}, name=${s.name}, enabled=${s.enabled}, enabled类型=${typeof s.enabled}, enabled===true: ${s.enabled === true}`);
|
||||
});
|
||||
|
||||
const enabledSources = sources.filter(s => s.enabled);
|
||||
console.log('[EmbyManager] 过滤后启用的源:', enabledSources.length, '个');
|
||||
return enabledSources;
|
||||
|
||||
@@ -133,6 +133,6 @@ function shouldSkipAuth(pathname: string): boolean {
|
||||
// 配置middleware匹配规则
|
||||
export const config = {
|
||||
matcher: [
|
||||
'/((?!_next/static|_next/image|favicon.ico|login|register|oidc-register|warning|api/login|api/register|api/logout|api/auth/oidc|api/cron/|api/server-config|api/proxy-m3u8|api/cms-proxy|api/tvbox/subscribe|api/theme/css|api/openlist/cms-proxy|api/openlist/play|api/emby/cms-proxy|api/emby/play).*)',
|
||||
'/((?!_next/static|_next/image|favicon.ico|login|register|oidc-register|warning|api/login|api/register|api/logout|api/auth/oidc|api/cron/|api/server-config|api/proxy-m3u8|api/cms-proxy|api/tvbox/subscribe|api/theme/css|api/openlist/cms-proxy|api/openlist/play|api/emby/cms-proxy|api/emby/play|api/emby/sources).*)',
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user