actor sync

This commit is contained in:
Lars Behrends
2025-11-06 13:08:02 +01:00
parent 3f56625205
commit a44c311e89
14 changed files with 773 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Services;
use App\Models\Game;
use App\Models\Source;
use App\Utils\ImageAspectRatioDetector;
class PlayniteImportService
{
@@ -100,6 +101,7 @@ class PlayniteImportService
// Rich media
'background_image' => $game['BackgroundImage'] ?? null,
'cover_image' => $game['CoverImage'] ?? null,
'cover_aspect_ratio' => $this->detectAspectRatio($game['CoverImage'] ?? null),
'icon' => $game['Icon'] ?? null,
// Multiple entities as JSON
@@ -410,6 +412,18 @@ class PlayniteImportService
$gameModel->update($gameId, $gameData);
}
/**
* Detect aspect ratio for an image URL
*/
private function detectAspectRatio(?string $imageUrl): ?float
{
if (!$imageUrl) {
return null;
}
return ImageAspectRatioDetector::detectAspectRatio($imageUrl);
}
/**
* Convert a value to boolean, handling empty strings properly
*/