mirror of
https://github.com/koel/koel
synced 2024-12-05 02:09:54 +00:00
26 lines
672 B
PHP
26 lines
672 B
PHP
|
<?php
|
||
|
namespace App\Http\Controllers\API\MediaInformation;
|
||
|
|
||
|
use App\Models\Song;
|
||
|
use Illuminate\Http\JsonResponse;
|
||
|
|
||
|
class SongController extends Controller
|
||
|
{
|
||
|
/**
|
||
|
* Get extra information about a song.
|
||
|
*
|
||
|
* @param Song $song
|
||
|
*
|
||
|
* @return JsonResponse
|
||
|
*/
|
||
|
public function show(Song $song)
|
||
|
{
|
||
|
return response()->json([
|
||
|
'lyrics' => $song->lyrics,
|
||
|
'album_info' => $this->mediaInformationService->getAlbumInformation($song->album),
|
||
|
'artist_info' => $this->mediaInformationService->getArtistInformation($song->artist),
|
||
|
'youtube' => $song->getRelatedYouTubeVideos(),
|
||
|
]);
|
||
|
}
|
||
|
}
|