# [1.0.0-alpha.59](https://code.podlibre.org/podlibre/castopod-host/compare/v1.0.0-alpha.58...v1.0.0-alpha.59) (2021-06-15)
### Bug Fixes
- check that additional files are valid when creating episode
([eac5bc8](https://code.podlibre.org/podlibre/castopod-host/commit/eac5bc876de125e1fe08d1b89f767a04fc0fbfb6))
# [1.0.0-alpha.58](https://code.podlibre.org/podlibre/castopod-host/compare/v1.0.0-alpha.57...v1.0.0-alpha.58) (2021-06-11)
### Bug Fixes
......
......@@ -11,7 +11,7 @@ declare(strict_types=1);
|
| NOTE: this constant is updated upon release with Continuous Integration.
*/
defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.58');
defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.59');
/*
| --------------------------------------------------------------------
......
......@@ -163,22 +163,28 @@ class EpisodeController extends BaseController
$transcriptChoice = $this->request->getPost('transcript-choice');
if (
$transcriptChoice === 'upload-file' &&
($transcriptFile = $this->request->getFile('transcript_file'))
$transcriptChoice === 'upload-file'
&& ($transcriptFile = $this->request->getFile('transcript_file'))
&& $transcriptFile->isValid()
) {
$newEpisode->transcript_file = $transcriptFile;
} elseif ($transcriptChoice === 'remote-url') {
$newEpisode->transcript_file_remote_url = $this->request->getPost('transcript_file_remote_url');
$newEpisode->transcript_file_remote_url = $this->request->getPost(
'transcript_file_remote_url'
) === '' ? null : $this->request->getPost('transcript_file_remote_url');
}
$chaptersChoice = $this->request->getPost('chapters-choice');
if (
$chaptersChoice === 'upload-file' &&
($chaptersFile = $this->request->getFile('chapters_file'))
$chaptersChoice === 'upload-file'
&& ($chaptersFile = $this->request->getFile('chapters_file'))
&& $chaptersFile->isValid()
) {
$newEpisode->chapters_file = $chaptersFile;
} elseif ($chaptersChoice === 'remote-url') {
$newEpisode->chapters_file_remote_url = $this->request->getPost('chapters_file_remote_url');
$newEpisode->chapters_file_remote_url = $this->request->getPost(
'chapters_file_remote_url'
) === '' ? null : $this->request->getPost('chapters_file_remote_url');
}
$episodeModel = new EpisodeModel();
......@@ -286,13 +292,12 @@ class EpisodeController extends BaseController
} elseif ($transcriptChoice === 'remote-url') {
if (
($transcriptFileRemoteUrl = $this->request->getPost('transcript_file_remote_url')) &&
(($transcriptFile = $this->episode->transcript_file) &&
$transcriptFile !== null)
(($transcriptFile = $this->episode->transcript_file) !== null)
) {
unlink((string) $transcriptFile);
$this->episode->transcript_file_path = null;
}
$this->episode->transcript_file_remote_url = $transcriptFileRemoteUrl;
$this->episode->transcript_file_remote_url = $transcriptFileRemoteUrl === '' ? null : $transcriptFileRemoteUrl;
}
$chaptersChoice = $this->request->getPost('chapters-choice');
......@@ -305,13 +310,12 @@ class EpisodeController extends BaseController
} elseif ($chaptersChoice === 'remote-url') {
if (
($chaptersFileRemoteUrl = $this->request->getPost('chapters_file_remote_url')) &&
(($chaptersFile = $this->episode->chapters_file) &&
$chaptersFile !== null)
(($chaptersFile = $this->episode->chapters_file) !== null)
) {
unlink((string) $chaptersFile);
$this->episode->chapters_file_path = null;
}
$this->episode->chapters_file_remote_url = $chaptersFileRemoteUrl;
$this->episode->chapters_file_remote_url = $chaptersFileRemoteUrl === '' ? null : $chaptersFileRemoteUrl;
}
$db = db_connect();
......
{
"name": "podlibre/castopod-host",
"version": "1.0.0-alpha58",
"version": "1.0.0-alpha59",
"type": "project",
"description": "Castopod Host is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"homepage": "https://castopod.org",
......
{
"name": "castopod-host",
"version": "1.0.0-alpha.58",
"version": "1.0.0-alpha.59",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0-alpha.58",
"version": "1.0.0-alpha.59",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@amcharts/amcharts4": "^4.10.17",
{
"name": "castopod-host",
"version": "1.0.0-alpha.58",
"version": "1.0.0-alpha.59",
"description": "Castopod Host is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"private": true,
"license": "AGPL-3.0-or-later",
......