CC-5693: API call to notify-item-start-playing fails because an invalid schedule id is sent
Temporary fix for this bug. Throw an exception if no schedule item is found.
This commit is contained in:
parent
873a62b8d7
commit
3b9608a8df
|
@ -396,12 +396,12 @@ class ApiController extends Zend_Controller_Action
|
||||||
Logging::debug("Received notification of new media item start: $media_id");
|
Logging::debug("Received notification of new media item start: $media_id");
|
||||||
Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
|
Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
|
||||||
|
|
||||||
|
try {
|
||||||
$historyService = new Application_Service_HistoryService();
|
$historyService = new Application_Service_HistoryService();
|
||||||
$historyService->insertPlayedItem($media_id);
|
$historyService->insertPlayedItem($media_id);
|
||||||
|
|
||||||
//set a 'last played' timestamp for media item
|
//set a 'last played' timestamp for media item
|
||||||
//needed for smart blocks
|
//needed for smart blocks
|
||||||
try {
|
|
||||||
$mediaType = Application_Model_Schedule::GetType($media_id);
|
$mediaType = Application_Model_Schedule::GetType($media_id);
|
||||||
if ($mediaType == 'file') {
|
if ($mediaType == 'file') {
|
||||||
$file_id = Application_Model_Schedule::GetFileId($media_id);
|
$file_id = Application_Model_Schedule::GetFileId($media_id);
|
||||||
|
|
|
@ -560,6 +560,9 @@ class Application_Service_HistoryService
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$item = CcScheduleQuery::create()->findPK($schedId, $this->con);
|
$item = CcScheduleQuery::create()->findPK($schedId, $this->con);
|
||||||
|
if (is_null($item)) {
|
||||||
|
throw new Exception("Invalid schedule id: ".$schedId);
|
||||||
|
}
|
||||||
|
|
||||||
//TODO figure out how to combine these all into 1 query.
|
//TODO figure out how to combine these all into 1 query.
|
||||||
$showInstance = $item->getCcShowInstances($this->con);
|
$showInstance = $item->getCcShowInstances($this->con);
|
||||||
|
|
Loading…
Reference in New Issue