Skip to content

Commit

Permalink
Fix series download
Browse files Browse the repository at this point in the history
  • Loading branch information
Bakual committed Dec 3, 2023
1 parent 0c4a9e5 commit 2a9b2d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions com_sermonspeaker/site/controllers/serie.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ public function download()

// Check if creating already in progress
$query = $db->getQuery(true);
$query->select('CASE WHEN `zip_created` < (' . $db->quote(Factory::getDate()->toSql()) . ' - INTERVAL 1 HOUR) THEN 1 ELSE `zip_state` END');
$query->select('CASE WHEN `zip_created` < (' . $db->quote(Factory::getDate()->toSql()) . ' - INTERVAL 1 HOUR) THEN 0 ELSE `zip_state` END');
$query->from('#__sermon_series');
$query->where('`id` = ' . $id);
$db->setQuery($query);

if (!$db->loadResult())
if ($db->loadResult())
{
$response = array(
'status' => '1',
Expand All @@ -221,7 +221,7 @@ public function download()

if ($count = count($files))
{
if (!Folder::exists($folder . 'series'))
if (!is_dir($folder . 'series'))
{
Folder::create($folder . 'series');
}
Expand Down

0 comments on commit 2a9b2d6

Please sign in to comment.