mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-07-14 08:41:11 +00:00
Add Transmission/NZBGet and per-client paths and much more
Extend multi-download-client support to include Transmission and NZBGet and introduce per-client custom download paths. Adds protocol mapping and new client types, Transmission/NZBGet integration services, API CRUD and validation changes, UI components/modal updates and live path previews, and manager routing by protocol. Includes DB migrations (download_path on download_history, interactive_search_access on users), schema updates, and related processor/service fixes and tests to ensure backward compatibility and proper path resolution.
This commit is contained in:
@@ -37,6 +37,7 @@ export async function PUT(
|
||||
remotePath,
|
||||
localPath,
|
||||
category,
|
||||
customPath,
|
||||
} = body;
|
||||
|
||||
const config = await getConfigService();
|
||||
@@ -53,6 +54,14 @@ export async function PUT(
|
||||
|
||||
const existingClient = clients[clientIndex];
|
||||
|
||||
// Validate customPath: reject paths containing ".."
|
||||
if (customPath && customPath.includes('..')) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Custom path cannot contain ".."' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Build updated client (preserve fields not in request)
|
||||
const updatedClient: DownloadClientConfig = {
|
||||
...existingClient,
|
||||
@@ -66,6 +75,7 @@ export async function PUT(
|
||||
remotePath: remotePath !== undefined ? remotePath : existingClient.remotePath,
|
||||
localPath: localPath !== undefined ? localPath : existingClient.localPath,
|
||||
category: category !== undefined ? category : existingClient.category,
|
||||
customPath: customPath !== undefined ? (customPath || undefined) : existingClient.customPath,
|
||||
};
|
||||
|
||||
// Validate path mapping if enabled
|
||||
|
||||
Reference in New Issue
Block a user