You are here

function zoomapi_download_meeting_recordings_from_tracker in Zoom API 7.2

Download meeting recordings.

2 calls to zoomapi_download_meeting_recordings_from_tracker()
zoomapi_cron in ./zoomapi.module
Implements hook_cron().
zoomapi_download_meeting_recordings_to_entity_worker in ./zoomapi.module
Queue Worker: Download meeting recordings for entity.

File

./zoomapi.module, line 943
Main file for the Zoom API module.

Code

function zoomapi_download_meeting_recordings_from_tracker($tracker) {
  try {
    if ($tracker->destination_type != 'entity') {
      throw new Exception('Meeting is not associated with an entity.');
    }
    list($entity_type, $entity_id, $field_name) = explode(':', $tracker->destination);
    $entity = entity_load_single($entity_type, $entity_id);
    if (!$entity) {
      throw new Exception('Unable to load entity to download meeting recordings.');
    }
    $data = is_array($tracker->data) ? $tracker->data : unserialize($tracker->data);
    return zoomapi_download_meeting_recordings_to_entity($entity, $entity_type, $field_name, $data);
  } catch (\Exception $e) {
    watchdog(__FUNCTION__, 'Unable to download pending meeting recordings for meeting. Error: @e -- Debug: !debug', [
      '@e' => $e
        ->getMessage(),
      '!debug' => '<pre>' . print_r($tracker, TRUE) . '</pre>',
    ], WATCHDOG_ERROR);
    return FALSE;
  }
}