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') {
|
||||
im_resize_gif($file_src, $file_dest, $max_width, $max_height);
|
||||
_error_log("im_resize_max_size($file_src) line=".__LINE__);
|
||||
@unlink($file_src);
|
||||
return true;
|
||||
}
|
||||
|
@ -2332,7 +2333,9 @@ function im_resize_max_size($file_src, $file_dest, $max_width, $max_height)
|
|||
imagedestroy($src);
|
||||
imagejpeg($dst, $file_dest); // adjust format as needed
|
||||
imagedestroy($dst);
|
||||
_error_log("im_resize_max_size($file_src) line=".__LINE__);
|
||||
@unlink($file_src);
|
||||
_error_log("im_resize_max_size($tmpFile) line=".__LINE__);
|
||||
@unlink($tmpFile);
|
||||
}
|
||||
|
||||
|
@ -2580,6 +2583,7 @@ function unzipDirectory($filename, $destination)
|
|||
}
|
||||
|
||||
// Delete the original zip file
|
||||
_error_log("unzipDirectory($filename) line=".__LINE__);
|
||||
@unlink($filename);
|
||||
}
|
||||
|
||||
|
@ -2635,6 +2639,7 @@ function cleanDirectory($dir, $allowedExtensions = ['key', 'm3u8', 'ts', 'vtt',
|
|||
}
|
||||
$path_parts = pathinfo($current);
|
||||
if (!empty($path_parts['extension']) && !in_array($path_parts['extension'], $allowedExtensions)) {
|
||||
_error_log("cleanDirectory($current) line=".__LINE__);
|
||||
unlink($current);
|
||||
}
|
||||
}
|
||||
|
@ -4380,6 +4385,7 @@ function convertImageToOG($source, $destination)
|
|||
$fileConverted = $tmpDir . "_jpg_" . uniqid() . ".jpg";
|
||||
convertImage($source, $fileConverted, 100);
|
||||
im_resize($fileConverted, $destination, $w, $h, 100);
|
||||
_error_log("convertImageToOG ($fileConverted) line=".__LINE__);
|
||||
@unlink($fileConverted);
|
||||
}
|
||||
}
|
||||
|
@ -4441,6 +4447,7 @@ function convertImageIfNotExists($source, $destination, $width, $height, $scaleU
|
|||
} else {
|
||||
_error_log("convertImageIfNotExists: convertImage error 2 $source, $fileConverted");
|
||||
}
|
||||
_error_log("convertImageToOG ($fileConverted) line=".__LINE__);
|
||||
@unlink($fileConverted);
|
||||
} catch (Exception $exc) {
|
||||
_error_log("convertImageIfNotExists: " . $exc->getMessage());
|
||||
|
@ -10379,6 +10386,8 @@ function deleteMediaSessionPosters($imagePath)
|
|||
|
||||
foreach ($sizes as $value) {
|
||||
$destination = str_replace('.jpg', "_{$value}.jpg", $imagePath);
|
||||
|
||||
_error_log("deleteMediaSessionPosters ($destination) line=".__LINE__);
|
||||
@unlink($destination);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2869,6 +2869,7 @@ if (!class_exists('Video')) {
|
|||
if (is_dir($file)) {
|
||||
self::rrmdir($file);
|
||||
} else {
|
||||
_error_log("removeFilePath ($file) line=".__LINE__);
|
||||
@unlink($file);
|
||||
}
|
||||
}
|
||||
|
@ -5496,6 +5497,7 @@ if (!class_exists('Video')) {
|
|||
if (isCommandLineInterface()) {
|
||||
echo "Deleting {$file} " . humanFileSize(filesize($file)) . PHP_EOL;
|
||||
}
|
||||
_error_log("Video:deleteThumbs($file) line=".__LINE__);
|
||||
@unlink($file);
|
||||
$totalDeleted++;
|
||||
}
|
||||
|
@ -5522,6 +5524,8 @@ if (!class_exists('Video')) {
|
|||
global $global;
|
||||
|
||||
$filePath = Video::getPathToFile($filename);
|
||||
|
||||
_error_log("Video:deleteGifAndWebp($filePath) line=".__LINE__);
|
||||
@unlink("{$filePath}.gif");
|
||||
@unlink("{$filePath}.webp");
|
||||
ObjectYPT::deleteCache($filename);
|
||||
|
|
|
@ -57,6 +57,8 @@ $paths = ADs::getAdsPath($type, @$_REQUEST['is_regular_user']);
|
|||
|
||||
$files = _glob($paths['path'], "/{$fileName}/");
|
||||
foreach ($files as $value) {
|
||||
|
||||
_error_log("deleteImage.json.php ($value) line=".__LINE__);
|
||||
unlink($value);
|
||||
}
|
||||
$result->type = $type;
|
||||
|
|
|
@ -306,13 +306,16 @@ class AVideoPlugin
|
|||
|
||||
public static function getHTMLMenuRight()
|
||||
{
|
||||
$name = "getHTMLMenuRight" . User::getId();
|
||||
$name = "getHTMLMenuRight_" . User::getId();
|
||||
//var_dump($name);
|
||||
$str = ObjectYPT::getCache($name, 3600);
|
||||
if (empty($str)) {
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
//var_dump($plugins);
|
||||
$str = "";
|
||||
foreach ($plugins as $value) {
|
||||
self::YPTstart();
|
||||
//var_dump($value['dirName']);
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$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->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->fileThumbs);
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ if (!empty($live_schedule_id)) {
|
|||
$obj->image = saveCroppieImage($obj->path, "image");
|
||||
if ($obj->image) {
|
||||
$obj->pathThumbs = $global['systemRootPath'] . Live::_getPosterThumbsImage(User::getId(), $live_servers_id, $posterType);
|
||||
|
||||
_error_log("removePoster.php ({$obj->pathThumbs}) line=".__LINE__);
|
||||
@unlink($obj->pathThumbs);
|
||||
$obj->error = false;
|
||||
}
|
||||
|
|
|
@ -1165,7 +1165,7 @@ function avideoAlert(title, msg, type) {
|
|||
avideoAlertHTMLText(title, msg, type);
|
||||
}
|
||||
|
||||
function avideoAlertOnce(title, msg, type, uid) {
|
||||
function avideoAlertWithCookie(title, msg, type, uid, expires) {
|
||||
var cookieName = 'avideoAlertOnce' + uid;
|
||||
if (!Cookies.get(cookieName)) {
|
||||
var span = document.createElement("span");
|
||||
|
@ -1180,13 +1180,30 @@ function avideoAlertOnce(title, msg, type, uid) {
|
|||
if (okay) {
|
||||
Cookies.set(cookieName, 1, {
|
||||
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) {
|
||||
var span = document.createElement("span");
|
||||
span.innerHTML = msg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue