mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 11:37:46 +02:00
refactor(persons): move podcast and episode persons models to person model for consistency
- fix lazy loading properties + podcast import controller - rename all snake_case variables to camelCase - fix broken routes - refactor Location construction logic and setters
This commit is contained in:
parent
6b74a9e98a
commit
93e605b406
48 changed files with 844 additions and 826 deletions
|
|
@ -39,18 +39,21 @@ class AnalyticsController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
public function getData(int $podcastId, int $episodeId): ResponseInterface
|
||||
{
|
||||
$analytics_model = new $this->className();
|
||||
public function getData(
|
||||
int $podcastId,
|
||||
?int $episodeId = null
|
||||
): ResponseInterface {
|
||||
$analyticsModel = new $this->className();
|
||||
$methodName = $this->methodName;
|
||||
if ($episodeId !== 0) {
|
||||
|
||||
if ($episodeId === null) {
|
||||
return $this->response->setJSON(
|
||||
$analytics_model->$methodName($podcastId, $episodeId),
|
||||
$analyticsModel->$methodName($podcastId),
|
||||
);
|
||||
}
|
||||
|
||||
return $this->response->setJSON(
|
||||
$analytics_model->$methodName($podcastId),
|
||||
$analyticsModel->$methodName($podcastId, $episodeId),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue