mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
actor sync
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user