Add request approval system and audiobook path template

Implements admin approval workflow for user requests with global and per-user auto-approve controls. Adds new request statuses ('awaiting_approval', 'denied'), related API endpoints, and UI for pending approvals. Introduces configurable audiobook organization path template with validation and preview in settings, updates database schema and migrations for new fields.
This commit is contained in:
kikootwo
2026-01-16 13:47:36 -05:00
parent 428d9a12e0
commit 3a9ae4a439
59 changed files with 4043 additions and 256 deletions
@@ -27,7 +27,7 @@ export function usePathsSettings({ paths, onChange, onValidationChange }: UsePat
};
/**
* Test if paths are valid and writable
* Test if paths are valid and writable, including template validation
*/
const testPaths = async () => {
setTesting(true);
@@ -40,6 +40,7 @@ export function usePathsSettings({ paths, onChange, onValidationChange }: UsePat
body: JSON.stringify({
downloadDir: paths.downloadDir,
mediaDir: paths.mediaDir,
audiobookPathTemplate: paths.audiobookPathTemplate,
}),
});
@@ -48,7 +49,8 @@ export function usePathsSettings({ paths, onChange, onValidationChange }: UsePat
if (data.success) {
const result: TestResult = {
success: true,
message: 'All paths are valid and writable'
message: 'All paths are valid and writable',
templateValidation: data.template
};
setTestResult(result);
onValidationChange(true);
@@ -56,10 +58,13 @@ export function usePathsSettings({ paths, onChange, onValidationChange }: UsePat
} else {
const result: TestResult = {
success: false,
message: data.error || 'Path validation failed'
message: data.error || 'Path validation failed',
templateValidation: data.template
};
setTestResult(result);
onValidationChange(false);
// Only mark as valid if paths are valid AND template is valid (if provided)
const isValid = false;
onValidationChange(isValid);
return result;
}
} catch (error) {