Skip to content

Commit

Permalink
read paella json data properly from mod, (#57)
Browse files Browse the repository at this point in the history
fixes #56
  • Loading branch information
ferishili authored Jan 14, 2025
1 parent 3ade3f8 commit 55141fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/text_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ protected function render_player(int $ocinstanceid, string $episodeid, bool $sho
int $playerid, $width = null, $height = null) {
global $OUTPUT, $PAGE, $COURSE;

$data = paella_transform::get_paella_data_json($ocinstanceid, $episodeid);
list($data, $errormessage) = paella_transform::get_paella_data_json($ocinstanceid, $episodeid);

if (!$data) {
return null;
Expand Down Expand Up @@ -253,9 +253,10 @@ protected function render_player(int $ocinstanceid, string $episodeid, bool $sho
$renderer = $PAGE->get_renderer('filter_opencast');
return $renderer->render_player($mustachedata);
} else {
$notificationmessage = !empty($errormessage) ? $errormessage : get_string('erroremptystreamsources', 'mod_opencast');
return $OUTPUT->render(new \core\output\notification(
get_string('erroremptystreamsources', 'mod_opencast'),
\core\output\notification::NOTIFY_ERROR
$notificationmessage,
\core\output\notification::NOTIFY_ERROR
));
}
}
Expand Down

0 comments on commit 55141fc

Please sign in to comment.