Skip to content

Commit

Permalink
https://github.com/WWBN/AVideo/issues/9694
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Dec 11, 2024
1 parent 13426cc commit 0a11e50
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions objects/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions objects/playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down
2 changes: 1 addition & 1 deletion objects/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;}
Expand Down
9 changes: 5 additions & 4 deletions plugin/Gallery/view/mainArea.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
$rowCount = getRowCount();
setRowCount($obj->PlayListsRowCount);
foreach ($plRows as $pl) {
$videos = PlayList::getAllFromPlaylistsID($pl['id']);
if(empty($videos)){
echo "<!-- there is no video for this playlist id = {$pl['id']} -->";
continue;
}
?>
<!-- For Playlist -->
<div class="clear clearfix">
Expand All @@ -100,10 +105,6 @@
<i class="fas fa-list"></i> <?php echo __($pl['name']); ?>
</a>
</h3>
<?php
$videos = PlayList::getAllFromPlaylistsID($pl['id']);
// need to add dechex because some times it return an negative value and make it fails on javascript playlists
?>
<div class="gallerySectionContent">
<?php
$countCols = createGallerySection($videos);
Expand Down

0 comments on commit 0a11e50

Please sign in to comment.