mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +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:
@@ -6,6 +6,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { requireAuth, AuthenticatedRequest } from '@/lib/middleware/auth';
|
||||
import { prisma } from '@/lib/db';
|
||||
import { resolvePermission, getGlobalBooleanSetting } from '@/lib/utils/permissions';
|
||||
|
||||
/**
|
||||
* GET /api/auth/me
|
||||
@@ -37,6 +38,7 @@ export async function GET(request: NextRequest) {
|
||||
authProvider: true,
|
||||
createdAt: true,
|
||||
lastLoginAt: true,
|
||||
interactiveSearchAccess: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -53,6 +55,14 @@ export async function GET(request: NextRequest) {
|
||||
// Determine if user is local admin (setup admin with local authentication)
|
||||
const isLocalAdmin = user.isSetupAdmin && user.plexId.startsWith('local-');
|
||||
|
||||
// Resolve effective permissions
|
||||
const globalInteractiveSearch = await getGlobalBooleanSetting('interactive_search_access', true);
|
||||
const effectiveInteractiveSearch = resolvePermission(
|
||||
user.role,
|
||||
user.interactiveSearchAccess,
|
||||
globalInteractiveSearch
|
||||
);
|
||||
|
||||
return NextResponse.json({
|
||||
user: {
|
||||
id: user.id,
|
||||
@@ -65,6 +75,9 @@ export async function GET(request: NextRequest) {
|
||||
authProvider: user.authProvider,
|
||||
createdAt: user.createdAt,
|
||||
lastLoginAt: user.lastLoginAt,
|
||||
permissions: {
|
||||
interactiveSearch: effectiveInteractiveSearch,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user