1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
Daniel Neto 2023-11-13 11:09:18 -03:00
parent 714a9a1820
commit bd3db04ab2
6 changed files with 37 additions and 44 deletions

View file

@ -10109,7 +10109,7 @@ function optimizeJS($html)
function mysqlBeginTransaction()
{
global $global;
_error_log('Begin transaction ' . getSelfURI());
//_error_log('Begin transaction ' . getSelfURI());
/**
*
* @var array $global
@ -10134,7 +10134,7 @@ function mysqlRollback()
function mysqlCommit()
{
global $global;
_error_log('Commit transaction ' . getSelfURI());
//_error_log('Commit transaction ' . getSelfURI());
/**
*
* @var array $global

View file

@ -1519,11 +1519,13 @@ if (typeof gtag !== \"function\") {
}
if ($pass !== false) {
if (!$encodedPass || $encodedPass === 'false') {
_error_log("Password check Old not encoded pass");
$passEncoded = md5($pass);
_error_log("Password check Old not encoded pass");
//_error_log("Password check Old not encoded pass passEncoded={$passEncoded}");
} else {
_error_log("Password check Old encoded pass");
$passEncoded = $pass;
_error_log("Password check Old encoded pass");
//_error_log("Password check Old encoded pass passEncoded={$passEncoded}");
}
$sql .= " AND password = ? ";
$formats .= "s";

View file

@ -1482,40 +1482,6 @@ if (!class_exists('Video')) {
return $rows;
}
private static function startTransaction()
{
global $global, $_video_startTransaction_started;
if (!empty($_video_startTransaction_started)) {
return false;
}
$_video_startTransaction_started = 1;
/**
*
* @var array $global
* @var object $global['mysqli']
*/
$global['mysqli']->begin_transaction();
return true;
}
private static function commitTransaction()
{
global $global, $_video_startTransaction_started;
if (empty($_video_startTransaction_started)) {
return false;
}
$_video_startTransaction_started = 0;
/**
*
* @var array $global
* @var object $global['mysqli']
*/
$global['mysqli']->commit();
return true;
}
/**
*
* @global array $global
@ -1860,7 +1826,7 @@ if (!class_exists('Video')) {
* @var array $global
* @var object $global['mysqli']
*/
self::startTransaction();
mysqlBeginTransaction();
foreach ($fullData as $index => $row) {
if (is_null($row['likes'])) {
_error_log("Video::updateLikesDislikes: id={$row['id']}");
@ -1872,7 +1838,6 @@ if (!class_exists('Video')) {
}
if (empty($row['duration_in_seconds']) && in_array($row['type'], $allowedDurationTypes)) {
self::startTransaction();
_error_log("Video::duration_in_seconds: id={$row['id']} {$row['duration']} {$row['type']}");
$row['duration_in_seconds'] = self::updateDurationInSeconds($row['id'], $row['duration']);
if (empty($row['duration_in_seconds'])) {
@ -1901,7 +1866,7 @@ if (!class_exists('Video')) {
$videos[] = $row;
}
TimeLogEnd("video::getAllVideos foreach", __LINE__, $tolerance);
self::commitTransaction();
mysqlCommit();
TimeLogEnd("video::getAllVideos foreach", __LINE__, $tolerance);
$rowCount = getRowCount();
$tolerance = $rowCount / 100;

View file

@ -8,8 +8,13 @@ function closeFloatVideo() {
clearTimeout(FloatVideoTimeout);
setTimeout(function () {
$('#videoCol').css('height', '');
$('#videoContainer').removeClass('animate__animated');
$('#videoContainer').removeClass('animate__bounceInDown');
$('#videoContainer').removeClass('animate__bounceInLeft');
if(windowIsfXs()){
$('#videoContainer').removeClass('animate__animated');
}else{
$('#videoContainer').addClass('animate__bounceIn');
}
$('body').removeClass('floatVideo');
}, 100);
}
@ -26,7 +31,11 @@ function setFloatVideo() {
var videoContainerHeight = $('#videoContainer').height();
$('#videoCol').height(videoContainerHeight);
$('#videoContainer').addClass('animate__animated');
if(windowIsfXs()){
$('#videoContainer').addClass('animate__bounceInDown');
}else{
$('#videoContainer').addClass('animate__bounceInLeft');
}
$('body').addClass('floatVideo');
}, 100);
}

View file

@ -4088,3 +4088,12 @@ function preloadVmapAndUpdateAdTag(adTagUrl) {
console.error("Error preloading and updating adTagUrl:", error);
});
}
function windowIsfXs() {
var screenWidth = $(window).width();
if (screenWidth < 768) {
return true;
} else {
return false;
}
}

View file

@ -192,14 +192,21 @@ if (!$searchForVideosNow) {
var loadVideosListPagerowCount = 'loadVideosListPagerowCount<?php User::getId(); ?>';
var loadVideosListPagesortBy = 'loadVideosListPagesortBy<?php User::getId(); ?>';
var loadVideosListPageTimeout;
var loadVideosListPageIsLoading = false;
function loadVideosListPage(page) {
clearTimeout(loadVideosListPageTimeout);
if (typeof modal === 'undefined') {
setTimeout(function () {
loadVideosListPage(page);
loadVideosListPageTimeout = loadVideosListPage(page);
}, 500);
return false;
}
if(loadVideosListPageIsLoading){
return false;
}
loadVideosListPageIsLoading = true;
var url = '<?php echo $link; ?>';
var rowCount = $('#rowCount').val();
@ -219,6 +226,7 @@ if (!$searchForVideosNow) {
url = addQueryStringParameter(url, 'current', page);
$.get(url, function (response) {
var videosList = $($.parseHTML(response)).filter("#videosListItems").html();
loadVideosListPageIsLoading = false;
$('#videosListItems').html(videosList);
//animateChilds('#videosListItems', 'animate__flipInX', 0.2);
lazyImage();