mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
Optional qBittorrent creds; require SABnzbd key
Allow qBittorrent to be configured without credentials (supports IP whitelist) and require an API key for SABnzbd. Skip connection testing when disabling a client. Updates include: validation changes in admin and setup API routes, test-download-client flows, DownloadClientModal UI validation and save/test logic, and DownloadClientManager to pass empty strings for optional credentials. Tests updated to reflect SABnzbd API key requirement.
This commit is contained in:
@@ -107,16 +107,18 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
|
||||
// Validate each client has required fields
|
||||
// qBittorrent credentials are optional (supports IP whitelist auth)
|
||||
// SABnzbd always requires API key
|
||||
for (const client of clients) {
|
||||
if (!client.url || !client.password) {
|
||||
if (!client.url) {
|
||||
return NextResponse.json(
|
||||
{ success: false, error: 'Download client URL and password/API key are required' },
|
||||
{ success: false, error: 'Download client URL is required' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
if (client.type === 'qbittorrent' && !client.username) {
|
||||
if (client.type === 'sabnzbd' && !client.password) {
|
||||
return NextResponse.json(
|
||||
{ success: false, error: 'qBittorrent username is required' },
|
||||
{ success: false, error: 'SABnzbd API key is required' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user