2020-06-12 13:55:45 +00:00
|
|
|
<?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;
|
|
|
|
}
|
|
|
|
|
2021-05-21 17:14:00 +00:00
|
|
|
public function show(Album $album): JsonResponse
|
2020-06-12 13:55:45 +00:00
|
|
|
{
|
|
|
|
return response()->json(['thumbnailUrl' => $this->mediaMetadataService->getAlbumThumbnailUrl($album)]);
|
|
|
|
}
|
|
|
|
}
|