Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 192... Línea 192...
192
        $currentfetchcache->set_many(array_flip(array_keys($recordings)));
192
        $currentfetchcache->set_many(array_flip(array_keys($recordings)));
193
        return $recordings;
193
        return $recordings;
194
    }
194
    }
Línea 195... Línea 195...
195
 
195
 
-
 
196
    /**
-
 
197
     * Helper function to retrieve recordings that failed to be fetched from a BigBlueButton server.
-
 
198
     *
-
 
199
     * @param array $keyids list of recordingids
-
 
200
     * @return array array of recording recordingids not fetched from server
-
 
201
     *  and sorted by {@see recording_proxy::sort_recordings}
-
 
202
     */
-
 
203
    public static function fetch_missing_recordings(array $keyids = []): array {
-
 
204
        $unfetchedids = [];
-
 
205
        $pagesize = 25;
-
 
206
        // If $ids is empty return array() to prevent a getRecordings with meetingID and recordID set to ''.
-
 
207
        if (empty($keyids)) {
-
 
208
            return $unfetchedids;
-
 
209
        }
-
 
210
        while ($ids = array_splice($keyids, 0, $pagesize)) {
-
 
211
            // We make getRecordings API call to check recordings are successfully retrieved.
-
 
212
            $xml = self::fetch_endpoint_xml('getRecordings', ['recordID' => implode(',', $ids), 'state' => 'any']);
-
 
213
            if (!$xml || $xml->returncode != 'SUCCESS' || !isset($xml->recordings)) {
-
 
214
                $unfetchedids = array_merge($unfetchedids, $ids);
-
 
215
                continue; // We will keep record of all unfetched ids.
-
 
216
            }
-
 
217
        }
-
 
218
        return $unfetchedids;
-
 
219
    }
-
 
220
 
196
    /**
221
    /**
197
     * Helper function to fetch recordings from a BigBlueButton server.
222
     * Helper function to fetch recordings from a BigBlueButton server.
198
     *
223
     *
199
     * @param array $keyids list of meetingids
224
     * @param array $keyids list of meetingids
200
     * @return array (associative) with recordings indexed by recordID, each recording is a non sequential array
225
     * @return array (associative) with recordings indexed by recordID, each recording is a non sequential array