2.2 KiB
2.2 KiB
title, tags
| title | tags | |||
|---|---|---|---|---|
| Settings Page |
|
Settings Page
Overview
App configuration and maintenance tools at /settings. Contains two card sections.
General Settings
Form using react-hook-form + zod validation.
| Field | Type | Description |
|---|---|---|
| TMDB API Key | Password input | Required for TMDB Integration |
| Backend Port | Number input | Port the backend server runs on (default 4000) |
Saved via PUT /api/v1/settings.
Cleanup
Maintenance tools for cleaning up orphaned data. Uses backend maintenance endpoints.
Orphan Files
Files that exist on disk but have no matching database record.
| Action | Button | Endpoint | Effect |
|---|---|---|---|
| Scan | Scan (outline) |
GET /maintenance/orphan-files |
Dry run — counts only |
| Delete | Delete (destructive) |
DELETE /maintenance/orphan-files |
Removes files from disk |
The Delete button only appears when the scan finds orphans.
Orphan Media Records
Database records that point to files that no longer exist on disk.
| Action | Button | Endpoint | Effect |
|---|---|---|---|
| Scan | Scan (outline) |
GET /maintenance/orphan-media-records |
Dry run — counts only |
| Delete | Delete (destructive) |
DELETE /maintenance/orphan-media-records |
Removes DB records |
Response Format
Both scan and delete return:
{ "posters": 0, "logos": 0, "backdrops": 0, "stills": 0 }
Displayed as: "3 poster(s), 1 backdrop(s)" or "None found".
Implementation Details
- State:
useStatefor scan results (OrphanResult | null) - Mutations:
useMutationfor scan and delete operations - Loading:
Loader2spinner on buttons during operations - Conditional rendering: Delete button only shown when
hasOrphans(result) === true
Important Files
| File | Role |
|---|---|
react_frontend/src/pages/SettingsPage.tsx |
Page component |
react_frontend/src/api/maintenance.ts |
API client |
backend/controllers/maintenanceController.js |
Route handlers |
backend/services/maintenanceService.js |
Business logic |
See Also
- API Reference#Maintenance — Endpoint details
- Media System — How media files are stored
- Env — Settings configuration