Skip to content

Commit

Permalink
Make sure only Videos with tokens are available thru the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrahn committed Sep 1, 2023
1 parent 2146bcc commit c5c2238
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Models/Videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ protected static function getFilteredVideos($query, $filters)
}

$where .= " AND trashed = " . $filters->getTrashed();
$where .= " AND oc_video.token IS NOT NULL";

$sql .= $where;

Expand Down Expand Up @@ -789,7 +790,7 @@ public static function addToCoursePlaylist($eventType, $episode, $video)
// get the courses this series belongs to
$series = SeminarSeries::findBySeries_id($episode->is_part_of);
foreach ($series as $s) {
// Only add video to default playlist if it is not connected to a different playlist in this course
// Only add video to default playlist if it is not connected to a any playlist in this course
$stmt = \DBManager::get()->prepare($sql = 'SELECT count(*) FROM oc_playlist_seminar
INNER JOIN oc_playlist_video ON (oc_playlist_video.playlist_id = oc_playlist_seminar.playlist_id)
WHERE oc_playlist_seminar.seminar_id = ?
Expand Down

0 comments on commit c5c2238

Please sign in to comment.