mirror of
https://github.com/koel/koel
synced 2024-12-20 01:23:16 +00:00
22 lines
630 B
PHP
22 lines
630 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\API\UploadPlaylistCoverRequest;
|
|
use App\Models\Playlist;
|
|
use App\Services\MediaMetadataService;
|
|
|
|
class UploadPlaylistCoverController extends Controller
|
|
{
|
|
public function __invoke(
|
|
UploadPlaylistCoverRequest $request,
|
|
Playlist $playlist,
|
|
MediaMetadataService $mediaMetadataService
|
|
) {
|
|
$this->authorize('own', $playlist);
|
|
$mediaMetadataService->writePlaylistCover($playlist, $request->getFileContent());
|
|
|
|
return response()->json(['cover_url' => $playlist->cover]);
|
|
}
|
|
}
|