mirror of
https://github.com/koel/koel
synced 2024-12-26 20:43:05 +00:00
27 lines
707 B
PHP
27 lines
707 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Podcast;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Resources\SongResource;
|
|
use App\Models\Podcast;
|
|
use App\Repositories\SongRepository;
|
|
use App\Services\PodcastService;
|
|
|
|
class PodcastEpisodeController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly SongRepository $episodeRepository,
|
|
private readonly PodcastService $podcastService
|
|
) {
|
|
}
|
|
|
|
public function index(Podcast $podcast)
|
|
{
|
|
if (request()->get('refresh')) {
|
|
$this->podcastService->refreshPodcast($podcast);
|
|
}
|
|
|
|
return SongResource::collection($this->episodeRepository->getEpisodesByPodcast($podcast));
|
|
}
|
|
}
|