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:
drigato 2014-02-10 16:19:26 -05:00
parent 873a62b8d7
commit 3b9608a8df
2 changed files with 8 additions and 5 deletions

View file

@ -395,13 +395,13 @@ class ApiController extends Zend_Controller_Action
$media_id = $this->_getParam("media_id");
Logging::debug("Received notification of new media item start: $media_id");
Application_Model_Schedule::UpdateMediaPlayedStatus($media_id);
$historyService = new Application_Service_HistoryService();
$historyService->insertPlayedItem($media_id);
//set a 'last played' timestamp for media item
//needed for smart blocks
try {
$historyService = new Application_Service_HistoryService();
$historyService->insertPlayedItem($media_id);
//set a 'last played' timestamp for media item
//needed for smart blocks
$mediaType = Application_Model_Schedule::GetType($media_id);
if ($mediaType == 'file') {
$file_id = Application_Model_Schedule::GetFileId($media_id);