koel/app/Http/Controllers/API/AlbumThumbnailController.php

21 lines
505 B
PHP
Raw Normal View History

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