Send Prowlarr search results directly to qBittorrent from the modal. Backend authenticates via SID cookie (login + add torrent endpoints). - Backend: qbittorrent module with add and test endpoints - Migration: add qbittorrent settings (url, username, password) - Settings UI: qBittorrent config card with test connection - ProwlarrSearchModal: send-to-qBittorrent button per result row with spinner/checkmark state progression - Button only shown when qBittorrent is configured Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
527 B
TypeScript
17 lines
527 B
TypeScript
import { NextResponse, NextRequest } from "next/server";
|
|
import { apiFetch } from "@/lib/api";
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
const body = await request.json();
|
|
const data = await apiFetch("/qbittorrent/add", {
|
|
method: "POST",
|
|
body: JSON.stringify(body),
|
|
});
|
|
return NextResponse.json(data);
|
|
} catch (error) {
|
|
const message = error instanceof Error ? error.message : "Failed to add torrent";
|
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
}
|
|
}
|