Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #554 #561

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes #554
  • Loading branch information
tgloeggl committed Mar 16, 2022
commit 4af49342656afcae9c366998ce9bda8285805330
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