mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Update
This commit is contained in:
parent
7343b9c3b3
commit
8fc17ef501
7 changed files with 42 additions and 4 deletions
|
@ -2274,6 +2274,7 @@ function im_resize_max_size($file_src, $file_dest, $max_width, $max_height)
|
||||||
|
|
||||||
if ($extension == 'gif') {
|
if ($extension == 'gif') {
|
||||||
im_resize_gif($file_src, $file_dest, $max_width, $max_height);
|
im_resize_gif($file_src, $file_dest, $max_width, $max_height);
|
||||||
|
_error_log("im_resize_max_size($file_src) line=".__LINE__);
|
||||||
@unlink($file_src);
|
@unlink($file_src);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2332,7 +2333,9 @@ function im_resize_max_size($file_src, $file_dest, $max_width, $max_height)
|
||||||
imagedestroy($src);
|
imagedestroy($src);
|
||||||
imagejpeg($dst, $file_dest); // adjust format as needed
|
imagejpeg($dst, $file_dest); // adjust format as needed
|
||||||
imagedestroy($dst);
|
imagedestroy($dst);
|
||||||
|
_error_log("im_resize_max_size($file_src) line=".__LINE__);
|
||||||
@unlink($file_src);
|
@unlink($file_src);
|
||||||
|
_error_log("im_resize_max_size($tmpFile) line=".__LINE__);
|
||||||
@unlink($tmpFile);
|
@unlink($tmpFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2580,6 +2583,7 @@ function unzipDirectory($filename, $destination)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete the original zip file
|
// Delete the original zip file
|
||||||
|
_error_log("unzipDirectory($filename) line=".__LINE__);
|
||||||
@unlink($filename);
|
@unlink($filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2635,6 +2639,7 @@ function cleanDirectory($dir, $allowedExtensions = ['key', 'm3u8', 'ts', 'vtt',
|
||||||
}
|
}
|
||||||
$path_parts = pathinfo($current);
|
$path_parts = pathinfo($current);
|
||||||
if (!empty($path_parts['extension']) && !in_array($path_parts['extension'], $allowedExtensions)) {
|
if (!empty($path_parts['extension']) && !in_array($path_parts['extension'], $allowedExtensions)) {
|
||||||
|
_error_log("cleanDirectory($current) line=".__LINE__);
|
||||||
unlink($current);
|
unlink($current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4379,7 +4384,8 @@ function convertImageToOG($source, $destination)
|
||||||
$tmpDir = getTmpDir();
|
$tmpDir = getTmpDir();
|
||||||
$fileConverted = $tmpDir . "_jpg_" . uniqid() . ".jpg";
|
$fileConverted = $tmpDir . "_jpg_" . uniqid() . ".jpg";
|
||||||
convertImage($source, $fileConverted, 100);
|
convertImage($source, $fileConverted, 100);
|
||||||
im_resize($fileConverted, $destination, $w, $h, 100);
|
im_resize($fileConverted, $destination, $w, $h, 100);
|
||||||
|
_error_log("convertImageToOG ($fileConverted) line=".__LINE__);
|
||||||
@unlink($fileConverted);
|
@unlink($fileConverted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4441,6 +4447,7 @@ function convertImageIfNotExists($source, $destination, $width, $height, $scaleU
|
||||||
} else {
|
} else {
|
||||||
_error_log("convertImageIfNotExists: convertImage error 2 $source, $fileConverted");
|
_error_log("convertImageIfNotExists: convertImage error 2 $source, $fileConverted");
|
||||||
}
|
}
|
||||||
|
_error_log("convertImageToOG ($fileConverted) line=".__LINE__);
|
||||||
@unlink($fileConverted);
|
@unlink($fileConverted);
|
||||||
} catch (Exception $exc) {
|
} catch (Exception $exc) {
|
||||||
_error_log("convertImageIfNotExists: " . $exc->getMessage());
|
_error_log("convertImageIfNotExists: " . $exc->getMessage());
|
||||||
|
@ -10379,6 +10386,8 @@ function deleteMediaSessionPosters($imagePath)
|
||||||
|
|
||||||
foreach ($sizes as $value) {
|
foreach ($sizes as $value) {
|
||||||
$destination = str_replace('.jpg', "_{$value}.jpg", $imagePath);
|
$destination = str_replace('.jpg', "_{$value}.jpg", $imagePath);
|
||||||
|
|
||||||
|
_error_log("deleteMediaSessionPosters ($destination) line=".__LINE__);
|
||||||
@unlink($destination);
|
@unlink($destination);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2869,6 +2869,7 @@ if (!class_exists('Video')) {
|
||||||
if (is_dir($file)) {
|
if (is_dir($file)) {
|
||||||
self::rrmdir($file);
|
self::rrmdir($file);
|
||||||
} else {
|
} else {
|
||||||
|
_error_log("removeFilePath ($file) line=".__LINE__);
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5496,6 +5497,7 @@ if (!class_exists('Video')) {
|
||||||
if (isCommandLineInterface()) {
|
if (isCommandLineInterface()) {
|
||||||
echo "Deleting {$file} " . humanFileSize(filesize($file)) . PHP_EOL;
|
echo "Deleting {$file} " . humanFileSize(filesize($file)) . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
_error_log("Video:deleteThumbs($file) line=".__LINE__);
|
||||||
@unlink($file);
|
@unlink($file);
|
||||||
$totalDeleted++;
|
$totalDeleted++;
|
||||||
}
|
}
|
||||||
|
@ -5522,6 +5524,8 @@ if (!class_exists('Video')) {
|
||||||
global $global;
|
global $global;
|
||||||
|
|
||||||
$filePath = Video::getPathToFile($filename);
|
$filePath = Video::getPathToFile($filename);
|
||||||
|
|
||||||
|
_error_log("Video:deleteGifAndWebp($filePath) line=".__LINE__);
|
||||||
@unlink("{$filePath}.gif");
|
@unlink("{$filePath}.gif");
|
||||||
@unlink("{$filePath}.webp");
|
@unlink("{$filePath}.webp");
|
||||||
ObjectYPT::deleteCache($filename);
|
ObjectYPT::deleteCache($filename);
|
||||||
|
|
|
@ -57,6 +57,8 @@ $paths = ADs::getAdsPath($type, @$_REQUEST['is_regular_user']);
|
||||||
|
|
||||||
$files = _glob($paths['path'], "/{$fileName}/");
|
$files = _glob($paths['path'], "/{$fileName}/");
|
||||||
foreach ($files as $value) {
|
foreach ($files as $value) {
|
||||||
|
|
||||||
|
_error_log("deleteImage.json.php ($value) line=".__LINE__);
|
||||||
unlink($value);
|
unlink($value);
|
||||||
}
|
}
|
||||||
$result->type = $type;
|
$result->type = $type;
|
||||||
|
|
|
@ -306,13 +306,16 @@ class AVideoPlugin
|
||||||
|
|
||||||
public static function getHTMLMenuRight()
|
public static function getHTMLMenuRight()
|
||||||
{
|
{
|
||||||
$name = "getHTMLMenuRight" . User::getId();
|
$name = "getHTMLMenuRight_" . User::getId();
|
||||||
|
//var_dump($name);
|
||||||
$str = ObjectYPT::getCache($name, 3600);
|
$str = ObjectYPT::getCache($name, 3600);
|
||||||
if (empty($str)) {
|
if (empty($str)) {
|
||||||
$plugins = Plugin::getAllEnabled();
|
$plugins = Plugin::getAllEnabled();
|
||||||
|
//var_dump($plugins);
|
||||||
$str = "";
|
$str = "";
|
||||||
foreach ($plugins as $value) {
|
foreach ($plugins as $value) {
|
||||||
self::YPTstart();
|
self::YPTstart();
|
||||||
|
//var_dump($value['dirName']);
|
||||||
$p = static::loadPlugin($value['dirName']);
|
$p = static::loadPlugin($value['dirName']);
|
||||||
if (is_object($p)) {
|
if (is_object($p)) {
|
||||||
$str .= $p->getHTMLMenuRight();
|
$str .= $p->getHTMLMenuRight();
|
||||||
|
|
|
@ -32,6 +32,7 @@ $obj->file = Live::_getPosterImage(User::getId(), $live_servers_id);
|
||||||
$obj->fileThumbs = Live::_getPosterThumbsImage(User::getId(), $live_servers_id);
|
$obj->fileThumbs = Live::_getPosterThumbsImage(User::getId(), $live_servers_id);
|
||||||
$obj->newPoster = 'plugin/Live/view/OnAir.jpg';
|
$obj->newPoster = 'plugin/Live/view/OnAir.jpg';
|
||||||
|
|
||||||
|
_error_log("removePoster.php ({$obj->file}) ({$obj->fileThumbs}) line=".__LINE__);
|
||||||
@unlink($global['systemRootPath'].$obj->file);
|
@unlink($global['systemRootPath'].$obj->file);
|
||||||
@unlink($global['systemRootPath'].$obj->fileThumbs);
|
@unlink($global['systemRootPath'].$obj->fileThumbs);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ if (!empty($live_schedule_id)) {
|
||||||
$obj->image = saveCroppieImage($obj->path, "image");
|
$obj->image = saveCroppieImage($obj->path, "image");
|
||||||
if ($obj->image) {
|
if ($obj->image) {
|
||||||
$obj->pathThumbs = $global['systemRootPath'] . Live::_getPosterThumbsImage(User::getId(), $live_servers_id, $posterType);
|
$obj->pathThumbs = $global['systemRootPath'] . Live::_getPosterThumbsImage(User::getId(), $live_servers_id, $posterType);
|
||||||
|
|
||||||
|
_error_log("removePoster.php ({$obj->pathThumbs}) line=".__LINE__);
|
||||||
@unlink($obj->pathThumbs);
|
@unlink($obj->pathThumbs);
|
||||||
$obj->error = false;
|
$obj->error = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1165,7 +1165,7 @@ function avideoAlert(title, msg, type) {
|
||||||
avideoAlertHTMLText(title, msg, type);
|
avideoAlertHTMLText(title, msg, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
function avideoAlertOnce(title, msg, type, uid) {
|
function avideoAlertWithCookie(title, msg, type, uid, expires) {
|
||||||
var cookieName = 'avideoAlertOnce' + uid;
|
var cookieName = 'avideoAlertOnce' + uid;
|
||||||
if (!Cookies.get(cookieName)) {
|
if (!Cookies.get(cookieName)) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement("span");
|
||||||
|
@ -1180,13 +1180,30 @@ function avideoAlertOnce(title, msg, type, uid) {
|
||||||
if (okay) {
|
if (okay) {
|
||||||
Cookies.set(cookieName, 1, {
|
Cookies.set(cookieName, 1, {
|
||||||
path: '/',
|
path: '/',
|
||||||
expires: 365
|
expires: expires
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function avideoAlertOnce(title, msg, type, uid) {
|
||||||
|
avideoAlertWithCookie(title, msg, type, uid, 365);
|
||||||
|
}
|
||||||
|
|
||||||
|
function avideoAlertOnceADay(title, msg, type, uid) {
|
||||||
|
// Calculate time until midnight
|
||||||
|
var now = new Date();
|
||||||
|
var midnight = new Date(now);
|
||||||
|
midnight.setHours(24, 0, 0, 0);
|
||||||
|
var timeUntilMidnight = (midnight - now) / 1000 / 60 / 60; // time in hours
|
||||||
|
|
||||||
|
// Call the main function with the calculated expiration
|
||||||
|
avideoAlertWithCookie(title, msg, type, uid, timeUntilMidnight / 24); // Convert time from hours to a fraction of a day
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function avideoConfirm(msg) {
|
async function avideoConfirm(msg) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement("span");
|
||||||
span.innerHTML = msg;
|
span.innerHTML = msg;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue