示例#1
0
 /**
  * @param BatchJob $dbBatchJob
  * @param kCaptureThumbJobData $data
  * @param BatchJob $twinJob
  * @return BatchJob
  */
 public static function handleCaptureThumbFailed(BatchJob $dbBatchJob, kCaptureThumbJobData $data, BatchJob $twinJob = null)
 {
     KalturaLog::debug("Captura thumbnail failed with destination file: " . $data->getThumbPath());
     if ($dbBatchJob->getAbort()) {
         return $dbBatchJob;
     }
     // verifies that thumb asset created
     if (!$data->getThumbAssetId()) {
         throw new APIException(APIErrors::INVALID_THUMB_ASSET_ID, $data->getThumbAssetId());
     }
     $thumbAsset = flavorAssetPeer::retrieveById($data->getThumbAssetId());
     // verifies that thumb asset exists
     if (!$thumbAsset) {
         throw new APIException(APIErrors::INVALID_THUMB_ASSET_ID, $data->getThumbAssetId());
     }
     $thumbAsset->incrementVersion();
     $thumbAsset->setStatus(thumbAsset::FLAVOR_ASSET_STATUS_ERROR);
     $thumbAsset->save();
     return $dbBatchJob;
 }
示例#2
0
 /**
  * @param BatchJob $dbBatchJob
  * @param kCaptureThumbJobData $data
  * @return BatchJob
  */
 public static function handleCaptureThumbFailed(BatchJob $dbBatchJob, kCaptureThumbJobData $data)
 {
     if ($dbBatchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED) {
         return $dbBatchJob;
     }
     // verifies that thumb asset created
     if (!$data->getThumbAssetId()) {
         throw new APIException(APIErrors::INVALID_THUMB_ASSET_ID, $data->getThumbAssetId());
     }
     $thumbAsset = assetPeer::retrieveById($data->getThumbAssetId());
     // verifies that thumb asset exists
     if (!$thumbAsset) {
         throw new APIException(APIErrors::INVALID_THUMB_ASSET_ID, $data->getThumbAssetId());
     }
     $thumbAsset->incrementVersion();
     $thumbAsset->setStatus(thumbAsset::FLAVOR_ASSET_STATUS_ERROR);
     $thumbAsset->save();
     self::handleLocalFileSyncDeletion($dbBatchJob->getEntryId(), $dbBatchJob->getPartner());
     return $dbBatchJob;
 }