From a24c2bfe1367cb89788f66c7dcc3494f8b5a4fac Mon Sep 17 00:00:00 2001 From: Till Date: Wed, 16 Mar 2022 16:39:33 +0100 Subject: [PATCH] fixes #554 (#561) --- classes/OCRestClient/SearchClient.php | 25 ------------------------- classes/OCRestClient/SeriesClient.php | 15 +++++++++++++++ controllers/course.php | 4 ++-- views/course/config.php | 4 ++-- 4 files changed, 19 insertions(+), 29 deletions(-) diff --git a/classes/OCRestClient/SearchClient.php b/classes/OCRestClient/SearchClient.php index 0a7edeae3..f26be6ce2 100644 --- a/classes/OCRestClient/SearchClient.php +++ b/classes/OCRestClient/SearchClient.php @@ -34,31 +34,6 @@ public function getSeries($series_id) } } - /** - * getAllSeries() - retrieves episode metadata for a given series identifier from conntected Opencast-Matterhorn - * Core - * - * @param void - * - * @return array response of series - */ - public function getAllSeries() - { - $service_url = "/series.json?limit=10000"; - - if ($series = $this->getJSON($service_url)) { - $x = "search-results"; - - if (is_array($series->$x->result)) { - return $series->$x->result; - } else { - return [$series->$x->result]; - } - } else { - return false; - } - } - public function getBaseURL() { $base = $this->base_url; diff --git a/classes/OCRestClient/SeriesClient.php b/classes/OCRestClient/SeriesClient.php index 2360cfdb6..1a1d10393 100644 --- a/classes/OCRestClient/SeriesClient.php +++ b/classes/OCRestClient/SeriesClient.php @@ -89,4 +89,19 @@ public function updateAccesscontrolForSeminar($series_id, $acl_data) return false; } } + + /** + * getAllSeries() - retrieves episode metadata for a given series + * identifier from conntected Opencast + * + * @param void + * + * @return array response of series + */ + public function getAllSeries() + { + $service_url = "/allSeriesIdTitle.json"; + + return $this->getJSON($service_url)->series; + } } diff --git a/controllers/course.php b/controllers/course.php index 23809e73d..2422962d6 100644 --- a/controllers/course.php +++ b/controllers/course.php @@ -345,8 +345,8 @@ public function config_action() $this->configs = OCConfig::getBaseServerConf(); foreach ($this->configs as $id => $config) { - $sclient = SearchClient::getInstance($id); - if ($series = $sclient->getAllSeries($this->course_id)) { + $sclient = SeriesClient::getInstance($id); + if ($series = $sclient->getAllSeries()) { $this->all_series[$id] = $series; } } diff --git a/views/course/config.php b/views/course/config.php index 832f1ef2a..7371f81ac 100644 --- a/views/course/config.php +++ b/views/course/config.php @@ -19,9 +19,9 @@ $config): ?> -