Skip to content

Commit e9e6905

Browse files
committed
Merge branch 'main' into issue-1269
2 parents debeb05 + 7be2551 commit e9e6905

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cronjobs/opencast_discover_videos.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ public function execute($last_result, $parameters = array())
176176
}
177177
} while (sizeof($oc_events) > 0);
178178

179-
// Check if local videos are not longer available in OC and remove them from Stud.IP
180-
// If the video should reappear in the future, Stud.IP will readd it again.
179+
// Check if local videos are no longer available in OC
181180
foreach (array_diff($local_event_ids, $event_ids) as $event_id) {
182181
$video = Videos::findOneBySql("config_id = ? AND episode = ?", [$config['id'], $event_id]);
183182
// Need null check for archived videos
184183
if ($video) {
185-
$video->delete();
184+
$video->setValue('available', false);
185+
$video->store();
186186
}
187187
}
188188

lib/Models/Videos.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ protected static function getFilteredVideos($query, $filters)
424424
$where .= " AND trashed = " . $filters->getTrashed();
425425
$where .= " AND oc_video.token IS NOT NULL";
426426

427+
// Show only videos available in opencast to users
428+
$where .= " AND oc_video.available = 1";
429+
427430
$sql .= $where;
428431

429432
$sql .= ' GROUP BY oc_video.id';

0 commit comments

Comments
 (0)