Skip to content

Commit

Permalink
SUP-16136: fixes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-arad committed Dec 5, 2018
1 parent 9478ca0 commit d8f790c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api_v3/lib/types/entry/KalturaLiveEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ public function doFromObject($dbObject, KalturaDetachedResponseProfile $response
$this->recordingOptions->fromObject($dbObject->getRecordingOptions());
}

if ($dbObject->getViewMode() == ViewMode::ALLOW_ALL && in_array($dbObject->getLiveStatus(), array(KalturaEntryServerNodeStatus::PLAYABLE, KalturaEntryServerNodeStatus::BROADCASTING)))
if ($this->isPlayable($dbObject))
{
$this->redirectEntryId = null;
kApiCache::setExpiry( kApiCache::REDIRECT_ENTRY_CACHE_EXPIRY );
} else
{
$this->redirectEntryId = $this->recordedEntryId;
Expand Down Expand Up @@ -351,4 +352,13 @@ private function hasPropertyChanged($sourceObject, $attr)
return false;
}

/**
* @param $dbObject
* @return bool
*/
protected function isPlayable($dbObject): bool
{
return $dbObject->getViewMode() == ViewMode::ALLOW_ALL && in_array($dbObject->getLiveStatus(), array(KalturaEntryServerNodeStatus::PLAYABLE, KalturaEntryServerNodeStatus::BROADCASTING, KalturaEntryServerNodeStatus::AUTHENTICATED));
}

}

0 comments on commit d8f790c

Please sign in to comment.