From c5c223887cc3cc7d9babdb133c30e43cfa9d066f Mon Sep 17 00:00:00 2001 From: srahn Date: Fri, 1 Sep 2023 11:07:02 +0200 Subject: [PATCH] Make sure only Videos with tokens are available thru the backend --- lib/Models/Videos.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Models/Videos.php b/lib/Models/Videos.php index 0430cee24..17c316a2b 100644 --- a/lib/Models/Videos.php +++ b/lib/Models/Videos.php @@ -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; @@ -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 = ?