Skip to content
Snippets Groups Projects
Unverified Commit fbad0b59 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix: update conditions when checking for empty max_episodes and season_number

parent 7047d5af
No related branches found
No related tags found
No related merge requests found
...@@ -288,10 +288,11 @@ class PodcastImportController extends BaseController ...@@ -288,10 +288,11 @@ class PodcastImportController extends BaseController
} }
$numberItems = $feed->channel[0]->item->count(); $numberItems = $feed->channel[0]->item->count();
$lastItem = $lastItem =
$this->request->getPost('max_episodes') !== null && $this->request->getPost('max_episodes') !== '' &&
$this->request->getPost('max_episodes') < $numberItems $this->request->getPost('max_episodes') < $numberItems
? $this->request->getPost('max_episodes') ? (int) $this->request->getPost('max_episodes')
: $numberItems; : $numberItems;
$slugs = []; $slugs = [];
...@@ -364,9 +365,9 @@ class PodcastImportController extends BaseController ...@@ -364,9 +365,9 @@ class PodcastImportController extends BaseController
? $itemNumber ? $itemNumber
: $nsItunes->episode, : $nsItunes->episode,
'season_number' => 'season_number' =>
$this->request->getPost('season_number') === null $this->request->getPost('season_number') === ''
? $nsItunes->season ? $nsItunes->season
: $this->request->getPost('season_number'), : (int) $this->request->getPost('season_number'),
'type' => property_exists($nsItunes, 'episodeType') && $nsItunes->episodeType !== null 'type' => property_exists($nsItunes, 'episodeType') && $nsItunes->episodeType !== null
? (string) $nsItunes->episodeType ? (string) $nsItunes->episodeType
: 'full', : 'full',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment