修正私人影库关闭后还能搜索到私人影库的视频和播放
This commit is contained in:
@@ -26,8 +26,14 @@ export async function GET(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
throw new Error('OpenList 未配置');
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
|
throw new Error('OpenList 未配置或未启用');
|
||||||
}
|
}
|
||||||
|
|
||||||
const rootPath = openListConfig.RootPath || '/';
|
const rootPath = openListConfig.RootPath || '/';
|
||||||
|
|||||||
@@ -39,9 +39,15 @@ export async function POST(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ error: 'OpenList 未配置' },
|
{ error: 'OpenList 未配置或未启用' },
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,9 +38,13 @@ export async function POST(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL) {
|
if (
|
||||||
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL
|
||||||
|
) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ error: 'OpenList 未配置' },
|
{ error: 'OpenList 未配置或未启用' },
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,14 @@ export async function GET(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
return NextResponse.json({ error: 'OpenList 未配置' }, { status: 400 });
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
|
return NextResponse.json({ error: 'OpenList 未配置或未启用' }, { status: 400 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const rootPath = openListConfig.RootPath || '/';
|
const rootPath = openListConfig.RootPath || '/';
|
||||||
|
|||||||
@@ -35,9 +35,15 @@ export async function GET(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ error: 'OpenList 未配置', list: [], total: 0 },
|
{ error: 'OpenList 未配置或未启用', list: [], total: 0 },
|
||||||
{ status: 200 }
|
{ status: 200 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,14 @@ export async function GET(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
return NextResponse.json({ error: 'OpenList 未配置' }, { status: 400 });
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
|
return NextResponse.json({ error: 'OpenList 未配置或未启用' }, { status: 400 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const rootPath = openListConfig.RootPath || '/';
|
const rootPath = openListConfig.RootPath || '/';
|
||||||
|
|||||||
@@ -30,8 +30,14 @@ export async function POST(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
return NextResponse.json({ error: 'OpenList 未配置' }, { status: 400 });
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
|
return NextResponse.json({ error: 'OpenList 未配置或未启用' }, { status: 400 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const rootPath = openListConfig.RootPath || '/';
|
const rootPath = openListConfig.RootPath || '/';
|
||||||
|
|||||||
@@ -43,9 +43,15 @@ export async function POST(request: NextRequest) {
|
|||||||
const config = await getConfig();
|
const config = await getConfig();
|
||||||
const openListConfig = config.OpenListConfig;
|
const openListConfig = config.OpenListConfig;
|
||||||
|
|
||||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
if (
|
||||||
|
!openListConfig ||
|
||||||
|
!openListConfig.Enabled ||
|
||||||
|
!openListConfig.URL ||
|
||||||
|
!openListConfig.Username ||
|
||||||
|
!openListConfig.Password
|
||||||
|
) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ error: 'OpenList 未配置' },
|
{ error: 'OpenList 未配置或未启用' },
|
||||||
{ status: 400 }
|
{ status: 400 }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,12 @@ export async function GET(request: NextRequest) {
|
|||||||
const apiSites = await getAvailableApiSites(authInfo.username);
|
const apiSites = await getAvailableApiSites(authInfo.username);
|
||||||
|
|
||||||
// 检查是否配置了 OpenList
|
// 检查是否配置了 OpenList
|
||||||
const hasOpenList = !!(config.OpenListConfig?.URL && config.OpenListConfig?.Username && config.OpenListConfig?.Password);
|
const hasOpenList = !!(
|
||||||
|
config.OpenListConfig?.Enabled &&
|
||||||
|
config.OpenListConfig?.URL &&
|
||||||
|
config.OpenListConfig?.Username &&
|
||||||
|
config.OpenListConfig?.Password
|
||||||
|
);
|
||||||
|
|
||||||
// 搜索 OpenList(如果配置了)
|
// 搜索 OpenList(如果配置了)
|
||||||
let openlistResults: any[] = [];
|
let openlistResults: any[] = [];
|
||||||
|
|||||||
@@ -34,7 +34,12 @@ export async function GET(request: NextRequest) {
|
|||||||
const apiSites = await getAvailableApiSites(authInfo.username);
|
const apiSites = await getAvailableApiSites(authInfo.username);
|
||||||
|
|
||||||
// 检查是否配置了 OpenList
|
// 检查是否配置了 OpenList
|
||||||
const hasOpenList = !!(config.OpenListConfig?.URL && config.OpenListConfig?.Username && config.OpenListConfig?.Password);
|
const hasOpenList = !!(
|
||||||
|
config.OpenListConfig?.Enabled &&
|
||||||
|
config.OpenListConfig?.URL &&
|
||||||
|
config.OpenListConfig?.Username &&
|
||||||
|
config.OpenListConfig?.Password
|
||||||
|
);
|
||||||
|
|
||||||
// 共享状态
|
// 共享状态
|
||||||
let streamClosed = false;
|
let streamClosed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user