eslint fix

This commit is contained in:
mtvpls
2026-01-23 16:41:49 +08:00
parent a167763324
commit 6eaed34b14
107 changed files with 311 additions and 318 deletions

View File

@@ -1,10 +1,10 @@
import { NextRequest, NextResponse } from 'next/server';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getStorage } from '@/lib/db';
import { getConfig } from '@/lib/config';
import { EmailService } from '@/lib/email.service';
import type { AdminConfig } from '@/lib/admin.types';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig } from '@/lib/config';
import { getStorage } from '@/lib/db';
import { EmailService } from '@/lib/email.service';
export const runtime = 'nodejs';

View File

@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from 'next/server';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig } from '@/lib/config';

View File

@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from 'next/server';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig } from '@/lib/config';
import { db } from '@/lib/db';
@@ -37,7 +38,6 @@ export async function POST(request: NextRequest) {
// 追加和覆盖合并Sources数组
if (data.Sources && Array.isArray(data.Sources)) {
const existingSources = adminConfig.EmbyConfig?.Sources || [];
const existingKeys = new Set(existingSources.map(s => s.key));
// 覆盖已存在的,追加新的
const mergedSources = [...existingSources];

View File

@@ -87,7 +87,7 @@ export async function POST(request: NextRequest) {
}
// 验证扫描间隔
let scanInterval = parseInt(ScanInterval) || 0;
const scanInterval = parseInt(ScanInterval) || 0;
if (scanInterval > 0 && scanInterval < 60) {
return NextResponse.json(
{ error: '定时扫描间隔最低为 60 分钟' },

View File

@@ -2,7 +2,6 @@
import { NextRequest, NextResponse } from 'next/server';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig } from '@/lib/config';
import { db } from '@/lib/db';
export const runtime = 'nodejs';
@@ -24,9 +23,6 @@ export async function GET(request: NextRequest) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
// 获取配置
const adminConfig = await getConfig();
// 判定操作者角色
let operatorRole: 'owner' | 'admin' | 'user' = 'user';
if (authInfo.username === process.env.USERNAME) {

View File

@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from 'next/server';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig } from '@/lib/config';
import { db } from '@/lib/db';