emby支持多源
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
import { embyManager } from '@/lib/emby-manager';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
|
||||
/**
|
||||
* 获取所有启用的Emby源列表
|
||||
*/
|
||||
export async function GET() {
|
||||
try {
|
||||
const sources = await embyManager.getEnabledSources();
|
||||
|
||||
return NextResponse.json({
|
||||
sources: sources.map(s => ({
|
||||
key: s.key,
|
||||
name: s.name,
|
||||
})),
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[Emby Sources] 获取Emby源列表失败:', error);
|
||||
return NextResponse.json(
|
||||
{ error: '获取Emby源列表失败', sources: [] },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user