From 7a2d53414b0184c6d89029894d6f56ac4d841742 Mon Sep 17 00:00:00 2001 From: Jonathan Champ Date: Thu, 18 Apr 2024 11:43:09 -0400 Subject: [PATCH] Apply suggestions from code review --- classes/task/get_meeting_recordings.php | 9 +++++++++ db/upgrade.php | 7 +------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/classes/task/get_meeting_recordings.php b/classes/task/get_meeting_recordings.php index 615479e2..4633187e 100644 --- a/classes/task/get_meeting_recordings.php +++ b/classes/task/get_meeting_recordings.php @@ -114,6 +114,15 @@ public function execute() { if (isset($localrecordings[$recording->meetinguuid][$recordingid])) { mtrace('Recording id: ' . $recordingid . ' exists...skipping'); + $localrecording = $localrecordings[$recording->meetinguuid][$recordingid]; + + if ($localrecording->recordingtype !== $zoom->recordingtype) { + $updatemeeting = (object) [ + 'id' => $localrecording->id, + 'recordingtype' => $zoom->recordingtype, + ]; + $DB->update_record('zoom_meeting_recordings', $updatemeeting); + } continue; } diff --git a/db/upgrade.php b/db/upgrade.php index 39f69569..f2d2f1e4 100755 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -966,16 +966,11 @@ function xmldb_zoom_upgrade($oldversion) { } if ($oldversion < 2024030101) { - // Update existing recording names to default for translatable recordingtype strings. $meetings = $DB->get_records('zoom'); foreach ($meetings as $meeting) { - var_dump($meeting); - $value = $meeting->name; - $select = "zoomid = ". $meeting->id; - - $DB->set_field_select('zoom_meeting_recordings', 'name', $value, $select); + $DB->set_field_select('zoom_meeting_recordings', 'name', $meeting->name, 'zoomid = ?', [$meeting->id]); } // Zoom savepoint reached.