Enhance API functionality and improve JWT authentication

- Added JWT authentication support in AuthService and JwtService.
- Implemented token generation and refresh mechanisms.
- Updated ApiAuthMiddleware to handle authentication for protected routes.
- Created ApiController and BaseApiController for standardized API responses.
- Developed MediaController for managing media items with pagination and search capabilities.
- Introduced DocsController for serving API documentation via Swagger UI.
- Added routes for API documentation and media management.
- Improved error handling and response formatting across API endpoints.
- Updated composer.json to include necessary JWT and Swagger UI dependencies.
This commit is contained in:
Lars Behrends
2025-12-31 10:08:49 +01:00
parent 1b053148f0
commit b728b0c72d
18 changed files with 858 additions and 27 deletions

View File

@@ -11,6 +11,30 @@ use SplFileInfo;
class LocalSyncService extends BaseSyncService implements SyncServiceInterface
{
/**
* @inheritDoc
*/
protected function executeSync(string $syncType): void
{
try {
$path = $this->source['path'] ?? null;
if (empty($path) || !is_dir($path)) {
throw new Exception("Invalid or inaccessible source path: {$path}");
}
$mediaType = $this->determineMediaType($this->source);
$this->logProgress("Starting {$syncType} sync for media type: {$mediaType}");
// Process the directory based on media type
$this->processDirectory($path, $mediaType);
$this->logProgress("Completed {$syncType} sync for media type: {$mediaType}");
} catch (Exception $e) {
$this->logProgress("Error during sync: " . $e->getMessage());
throw $e;
}
}
protected string $sourceType = 'local';
/**