From 0a11e504c686c1aa8b692def8e11d6247fcb1383 Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Wed, 11 Dec 2024 15:06:22 -0300 Subject: [PATCH] https://github.com/WWBN/AVideo/issues/9694 --- objects/Object.php | 12 ++++++++++++ objects/playlist.php | 1 + objects/video.php | 2 +- plugin/Gallery/view/mainArea.php | 9 +++++---- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/objects/Object.php b/objects/Object.php index 2b4e3e76b7db..84a0dfee2f9b 100644 --- a/objects/Object.php +++ b/objects/Object.php @@ -329,6 +329,18 @@ public function save() $fields[] = " {$value} = now() "; } elseif (strtolower($value) == 'modified_php_time') { $fields[] = " {$value} = " . time(); + } elseif (strtolower($value) == 'created_php_time') { + if(empty($this->created_php_time)){ + if(!empty($this->created)){ + $formats .= 'i'; + $values[] = strtotime($this->created); + $fields[] = " `{$value}` = ? "; + }else{ + $formats .= 'i'; + $values[] = time(); + $fields[] = " `{$value}` = ? "; + } + } } elseif (strtolower($value) == 'timezone') { if (empty($this->$value)) { $this->$value = date_default_timezone_get(); diff --git a/objects/playlist.php b/objects/playlist.php index d9cafc4ba84c..54024756925d 100644 --- a/objects/playlist.php +++ b/objects/playlist.php @@ -96,6 +96,7 @@ public static function getAllFromPlaylistsID($playlists_id) return array(); } $videosP = Video::getAllVideos(Video::SORT_TYPE_VIEWABLE, false, true, $videosArrayId, false, true); + //$videosP = PlayList::sortVideos($videosP, $videosArrayId); foreach ($videosP as $key => $value2) { if (empty($videosP[$key]['type'])) { diff --git a/objects/video.php b/objects/video.php index 6f374869d280..73436149076a 100644 --- a/objects/video.php +++ b/objects/video.php @@ -1924,6 +1924,7 @@ public static function getAllVideos($status = Video::SORT_TYPE_VIEWABLE, $showOn if (!empty($videosArrayId) && is_array($videosArrayId) && (is_numeric($videosArrayId[0]))) { $sql .= self::getSQLByStatus(Video::SORT_TYPE_VIEWABLE, true); $sql .= " ORDER BY FIELD(v.id, '" . implode("', '", $videosArrayId) . "') "; + $sql .= self::getSqlLimit(); } else { $sortType = Video::SORT_TYPE_VIEWABLE; if ($suggestedOnly) { @@ -1957,7 +1958,6 @@ public static function getAllVideos($status = Video::SORT_TYPE_VIEWABLE, $showOn } } } - //var_dump($max_duration_in_seconds);echo $sql; //exit; //_error_log("getAllVideos($status, $showOnlyLoggedUserVideos , $ignoreGroup , ". json_encode($videosArrayId).")" . $sql); //if($status == Video::SORT_TYPE_VIEWABLE){ var_dump($sql);exit;} diff --git a/plugin/Gallery/view/mainArea.php b/plugin/Gallery/view/mainArea.php index 316911c72e3a..9e7dbddf95db 100644 --- a/plugin/Gallery/view/mainArea.php +++ b/plugin/Gallery/view/mainArea.php @@ -92,6 +92,11 @@ $rowCount = getRowCount(); setRowCount($obj->PlayListsRowCount); foreach ($plRows as $pl) { + $videos = PlayList::getAllFromPlaylistsID($pl['id']); + if(empty($videos)){ + echo ""; + continue; + } ?>
@@ -100,10 +105,6 @@ -