koel/app/Http/Controllers/API/AlbumThumbnailController.php
2021-05-21 19:14:00 +02:00

22 lines
557 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Models\Album;
use App\Services\MediaMetadataService;
use Illuminate\Http\JsonResponse;
class AlbumThumbnailController extends Controller
{
private $mediaMetadataService;
public function __construct(MediaMetadataService $mediaMetadataService)
{
$this->mediaMetadataService = $mediaMetadataService;
}
public function show(Album $album): JsonResponse
{
return response()->json(['thumbnailUrl' => $this->mediaMetadataService->getAlbumThumbnailUrl($album)]);
}
}