Skip to content

Commit

Permalink
fixes #554 (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl authored Mar 16, 2022
1 parent a489655 commit a24c2bf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 29 deletions.
25 changes: 0 additions & 25 deletions classes/OCRestClient/SearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions classes/OCRestClient/SeriesClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions controllers/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions views/course/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<? foreach ($configs as $id => $config): ?>
<optgroup label="<?= $_(sprintf('%s. Opencast-System', $id)) ?>">
<? foreach ($all_series[$id] as $serie) : ?>
<option value='{"config_id":"<?= $id ?>", "series_id":"<?= $serie->id ?>"}'
<option value='{"config_id":"<?= $id ?>", "series_id":"<?= $serie->identifier ?>"}'
class="nested-item">
<?= htmlReady($serie->dcTitle) ?>
<?= htmlReady($serie->title) ?>
</option>
<? endforeach; ?>
</optgroup>
Expand Down

0 comments on commit a24c2bf

Please sign in to comment.