Skip to content

Commit

Permalink
Use withmetadata query parameter when necessary only - refs #342
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Kollenbroich committed Nov 8, 2023
1 parent d00a1f5 commit d608ec2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion block_opencast.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function get_content() {
try {
if ($instance->isvisible) {
$apibridge = \block_opencast\local\apibridge::get_instance($instance->id);
$videos[$instance->id] = $apibridge->get_block_videos($COURSE->id, false);
$videos[$instance->id] = $apibridge->get_block_videos($COURSE->id);
}
} catch (opencast_connection_exception $e) {
$videos[$instance->id] = new stdClass();
Expand Down
4 changes: 2 additions & 2 deletions classes/local/apibridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function get_upload_xml_file($filename, $filedata) {
* @param bool $withmetadata
* @return \stdClass
*/
public function get_block_videos($courseid, $withmetadata = true) {
public function get_block_videos($courseid, $withmetadata = false) {
if (defined('BEHAT_SITE_RUNNING')) {
$withmetadata = true;
}
Expand Down Expand Up @@ -410,7 +410,7 @@ public function get_course_videos($courseid, $sortcolumns = null) {
* @param bool $withmetadata
* @return array
*/
public function get_series_videos($series, $sortcolumns = null, $withmetadata = true) {
public function get_series_videos($series, $sortcolumns = null, $withmetadata = false) {
if (defined('BEHAT_SITE_RUNNING')) {
$withmetadata = true;
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
$errors = 0;

foreach ($courseseries as $series) {
$seriesvideodata[$series->series] = $opencast->get_series_videos($series->series, $sortcolumns, false);
$seriesvideodata[$series->series] = $opencast->get_series_videos($series->series, $sortcolumns);
if ($seriesvideodata[$series->series]->error) {
$errors += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion overview_videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
get_string('heading_actions', 'block_opencast'));
$table = $renderer->create_overview_videos_table('ignore', $headers, $columns, $baseurl);

$videos = $apibridge->get_series_videos($series, null, false)->videos;
$videos = $apibridge->get_series_videos($series)->videos;
$activityinstalled = \core_plugin_manager::instance()->get_plugin_info('mod_opencast') != null;
$showchangeownerlink = has_capability('block/opencast:viewusers', context_system::instance()) &&
!empty(get_config('block_opencast', 'aclownerrole_' . $ocinstanceid));
Expand Down
4 changes: 2 additions & 2 deletions tests/helper/apibridge_testable.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function get_opencast_video($identifier, bool $withpublications = false,
* @param bool $withmetadata
* @return stdClass
*/
public function get_series_videos($series, $sortcolumns = null, $withmetadata = true) {
public function get_series_videos($series, $sortcolumns = null, $withmetadata = false) {
$result = new stdClass();
$result->error = 0;

Expand Down Expand Up @@ -200,7 +200,7 @@ public function get_series_videos($series, $sortcolumns = null, $withmetadata =
* @param bool $withmetadata
* @return stdClass
*/
public function get_block_videos($courseid, $withmetadata = true) {
public function get_block_videos($courseid, $withmetadata = false) {
// Used for behat test.
$result = new \stdClass();
$result->count = 0;
Expand Down

0 comments on commit d608ec2

Please sign in to comment.