动漫订阅增加排除关键词
This commit is contained in:
@@ -40,6 +40,10 @@ export async function PUT(
|
||||
if (updates.filterText !== undefined) {
|
||||
subscription.filterText = updates.filterText.trim();
|
||||
}
|
||||
if (updates.excludeText !== undefined) {
|
||||
subscription.excludeText =
|
||||
typeof updates.excludeText === 'string' ? updates.excludeText.trim() : '';
|
||||
}
|
||||
if (updates.source !== undefined) {
|
||||
if (!['acgrip', 'mikan', 'dmhy', 'nyaa'].includes(updates.source)) {
|
||||
return NextResponse.json({ error: '无效的搜索源' }, { status: 400 });
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function POST(req: NextRequest) {
|
||||
return NextResponse.json({ error: '无权限访问' }, { status: 403 });
|
||||
}
|
||||
|
||||
const { title, filterText, source, enabled, lastEpisode } =
|
||||
const { title, filterText, excludeText, source, enabled, lastEpisode } =
|
||||
await req.json();
|
||||
|
||||
// 验证必填字段
|
||||
@@ -93,6 +93,7 @@ export async function POST(req: NextRequest) {
|
||||
id: crypto.randomUUID(),
|
||||
title: title.trim(),
|
||||
filterText: filterText.trim(),
|
||||
excludeText: typeof excludeText === 'string' ? excludeText.trim() : '',
|
||||
source,
|
||||
enabled: enabled ?? true,
|
||||
lastCheckTime: 0,
|
||||
|
||||
Reference in New Issue
Block a user