移除openlist token的输入
This commit is contained in:
@@ -39,7 +39,7 @@ export async function POST(request: NextRequest) {
|
||||
const config = await getConfig();
|
||||
const openListConfig = config.OpenListConfig;
|
||||
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Token) {
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
||||
return NextResponse.json(
|
||||
{ error: 'OpenList 未配置' },
|
||||
{ status: 400 }
|
||||
@@ -49,7 +49,6 @@ export async function POST(request: NextRequest) {
|
||||
const rootPath = openListConfig.RootPath || '/';
|
||||
const client = new OpenListClient(
|
||||
openListConfig.URL,
|
||||
openListConfig.Token,
|
||||
openListConfig.Username,
|
||||
openListConfig.Password
|
||||
);
|
||||
|
||||
@@ -35,7 +35,7 @@ export async function GET(request: NextRequest) {
|
||||
const config = await getConfig();
|
||||
const openListConfig = config.OpenListConfig;
|
||||
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Token) {
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
||||
return NextResponse.json({ error: 'OpenList 未配置' }, { status: 400 });
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ export async function GET(request: NextRequest) {
|
||||
const folderPath = `${rootPath}${rootPath.endsWith('/') ? '' : '/'}${folderName}`;
|
||||
const client = new OpenListClient(
|
||||
openListConfig.URL,
|
||||
openListConfig.Token,
|
||||
openListConfig.Username,
|
||||
openListConfig.Password
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function GET(request: NextRequest) {
|
||||
const config = await getConfig();
|
||||
const openListConfig = config.OpenListConfig;
|
||||
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Token) {
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
||||
return NextResponse.json(
|
||||
{ error: 'OpenList 未配置', list: [], total: 0 },
|
||||
{ status: 200 }
|
||||
@@ -44,7 +44,6 @@ export async function GET(request: NextRequest) {
|
||||
const rootPath = openListConfig.RootPath || '/';
|
||||
const client = new OpenListClient(
|
||||
openListConfig.URL,
|
||||
openListConfig.Token,
|
||||
openListConfig.Username,
|
||||
openListConfig.Password
|
||||
);
|
||||
|
||||
@@ -31,7 +31,7 @@ export async function GET(request: NextRequest) {
|
||||
const config = await getConfig();
|
||||
const openListConfig = config.OpenListConfig;
|
||||
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Token) {
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
||||
return NextResponse.json({ error: 'OpenList 未配置' }, { status: 400 });
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const client = new OpenListClient(
|
||||
openListConfig.URL,
|
||||
openListConfig.Token,
|
||||
openListConfig.Username,
|
||||
openListConfig.Password
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ export async function POST(request: NextRequest) {
|
||||
const config = await getConfig();
|
||||
const openListConfig = config.OpenListConfig;
|
||||
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Token) {
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
||||
return NextResponse.json({ error: 'OpenList 未配置' }, { status: 400 });
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ export async function POST(request: NextRequest) {
|
||||
const folderPath = `${rootPath}${rootPath.endsWith('/') ? '' : '/'}${folder}`;
|
||||
const client = new OpenListClient(
|
||||
openListConfig.URL,
|
||||
openListConfig.Token,
|
||||
openListConfig.Username,
|
||||
openListConfig.Password
|
||||
);
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function POST(request: NextRequest) {
|
||||
const config = await getConfig();
|
||||
const openListConfig = config.OpenListConfig;
|
||||
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Token) {
|
||||
if (!openListConfig || !openListConfig.URL || !openListConfig.Username || !openListConfig.Password) {
|
||||
return NextResponse.json(
|
||||
{ error: 'OpenList 未配置' },
|
||||
{ status: 400 }
|
||||
@@ -66,7 +66,6 @@ export async function POST(request: NextRequest) {
|
||||
performScan(
|
||||
taskId,
|
||||
openListConfig.URL,
|
||||
openListConfig.Token,
|
||||
openListConfig.RootPath || '/',
|
||||
tmdbApiKey,
|
||||
tmdbProxy,
|
||||
@@ -97,20 +96,18 @@ export async function POST(request: NextRequest) {
|
||||
async function performScan(
|
||||
taskId: string,
|
||||
url: string,
|
||||
token: string,
|
||||
rootPath: string,
|
||||
tmdbApiKey: string,
|
||||
tmdbProxy?: string,
|
||||
username?: string,
|
||||
password?: string
|
||||
): Promise<void> {
|
||||
const client = new OpenListClient(url, token, username, password);
|
||||
const client = new OpenListClient(url, username!, password!);
|
||||
|
||||
console.log('[OpenList Refresh] 开始扫描:', {
|
||||
taskId,
|
||||
rootPath,
|
||||
url,
|
||||
hasToken: !!token,
|
||||
});
|
||||
|
||||
// 立即更新进度,确保任务可被查询
|
||||
|
||||
Reference in New Issue
Block a user