mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
33 lines
1.8 KiB
PHP
33 lines
1.8 KiB
PHP
<?php
|
|
|
|
use Psr\Http\Message\ResponseInterface as Response;
|
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
use Slim\Routing\RouteCollectorProxy;
|
|
|
|
// API routes (no authentication required for basic operations)
|
|
$app->group('/api', function (RouteCollectorProxy $apiGroup) {
|
|
|
|
// Playnite API endpoints
|
|
$apiGroup->group('/playnite', function (RouteCollectorProxy $playniteGroup) {
|
|
// Game management
|
|
$playniteGroup->post('/insert', 'App\Controllers\Api\PlayniteController:insertGames')->setName('api.playnite.insert');
|
|
$playniteGroup->post('/media', 'App\Controllers\Api\PlayniteController:updateMedia')->setName('api.playnite.media');
|
|
$playniteGroup->put('/update/games/', 'App\Controllers\Api\PlayniteController:updateGames')->setName('api.playnite.update');
|
|
$playniteGroup->put('/v1/games/delete', 'App\Controllers\Api\PlayniteController:deleteGames')->setName('api.playnite.delete');
|
|
|
|
// Image upload
|
|
$playniteGroup->post('/image/base64', 'App\Controllers\Api\PlayniteController:uploadImages')->setName('api.playnite.images');
|
|
});
|
|
|
|
// Actor API endpoints
|
|
$apiGroup->group('/actors', function (RouteCollectorProxy $actorGroup) {
|
|
$actorGroup->post('/fetch-stash', 'App\Controllers\ActorController:fetchStashData')->setName('api.actors.fetch-stash');
|
|
$actorGroup->post('/sync-existing-stash', 'App\Controllers\ActorController:syncExistingPerformers')->setName('api.actors.sync-existing-stash');
|
|
$actorGroup->get('/missing-stash-reports', 'App\Controllers\ActorController:getMissingStashReports')->setName('api.actors.missing-reports');
|
|
});
|
|
|
|
// User authentication check (requires authentication)
|
|
$apiGroup->get('/v1/users/me', 'App\Controllers\Api\AuthController:checkAuth')->setName('api.auth.check')->add('App\Http\Middleware\AuthMiddleware');
|
|
|
|
});
|