Skip to content

Commit

Permalink
Merge pull request #516 from jrchamp/fix/recordingtype-should-be-code
Browse files Browse the repository at this point in the history
recordings: use type codes, not language strings
  • Loading branch information
jrchamp authored Sep 7, 2023
2 parents 27d438e + 2c8b636 commit 3e3468c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions classes/task/get_meeting_recordings.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ public function execute() {

mtrace('Finding meeting recordings for this account...');

$recordingtypestrings = [
'audio' => get_string('recordingtypeaudio', 'mod_zoom'),
'video' => get_string('recordingtypevideo', 'mod_zoom'),
];

$zoommeetings = zoom_get_all_meeting_records();
foreach ($zoommeetings as $zoom) {
// Only get recordings for this meeting if its recurring or already finished.
Expand All @@ -91,14 +96,16 @@ public function execute() {
continue;
}

$recordingtypestring = $recordingtypestrings[$zoomrecordinginfo->recordingtype];

$rec = new \stdClass();
$rec->zoomid = $zoom->id;
$rec->meetinguuid = trim($zoomrecordinginfo->meetinguuid);
$rec->zoomrecordingid = trim($zoomrecordinginfo->recordingid);
$rec->name = trim($zoom->name) . ' (' . trim($zoomrecordinginfo->recordingtype) . ')';
$rec->name = trim($zoom->name) . ' (' . $recordingtypestring . ')';
$rec->externalurl = $zoomrecordinginfo->url;
$rec->passcode = trim($zoomrecordinginfo->passcode);
$rec->recordingtype = trim($zoomrecordinginfo->recordingtype);
$rec->recordingtype = $zoomrecordinginfo->recordingtype;
$rec->recordingstart = $recordingstarttime;
$rec->showrecording = $zoom->recordings_visible_default;
$rec->timecreated = $now;
Expand Down
6 changes: 3 additions & 3 deletions classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,16 +970,16 @@ public function get_recording_url_list($meetingid) {
$settingsresponse = $this->make_call($settingsurl);
foreach ($response->recording_files as $rec) {
if (!empty($rec->play_url) && in_array($rec->file_type, $allowedrecordingtypes, true)) {
$type = (!empty($rec->recording_type) && $rec->recording_type === 'audio_only') ? 'audio' : 'video';

// Only pick the video recording and audio only recordings.
// The transcript is available in both of these, so the extra file is unnecessary.
$recordinginfo = new stdClass();
$recordinginfo->recordingid = $rec->id;
$recordinginfo->meetinguuid = $rec->meeting_id;
$recordinginfo->url = $rec->play_url;
$recordinginfo->filetype = $rec->file_type;
$recordinginfo->recordingtype = (!empty($rec->recording_type) && $rec->recording_type === 'audio_only') ?
get_string('recordingtypeaudio', 'mod_zoom') :
get_string('recordingtypevideo', 'mod_zoom');
$recordinginfo->recordingtype = $recordingtype;
$recordinginfo->passcode = $settingsresponse->password;
$recordings[strtotime($rec->recording_start)][] = $recordinginfo;
}
Expand Down

0 comments on commit 3e3468c

Please sign in to comment.