1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Fix delete thumbs

This commit is contained in:
Daniel 2021-12-08 19:02:10 -03:00
parent ea5d148d9c
commit 6fa7cb627e
2 changed files with 2 additions and 2 deletions

View file

@ -7,6 +7,7 @@ require_once $global['systemRootPath'] . 'objects/video.php';
if (!isCommandLineInterface()) {
return die('Command Line only');
}
ob_end_flush();
$checkIfIsCorrupted = intval(@$argv[1]);
echo "checkIfIsCorrupted = $checkIfIsCorrupted".PHP_EOL;
$users_ids = array();
@ -23,7 +24,6 @@ if ($res != false) {
$filename = $row['filename'];
Video::deleteThumbs($filename, true, $checkIfIsCorrupted);
echo "{$total}/{$count} Thumbs deleted from {$row['title']}".PHP_EOL;
ob_flush();
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);

View file

@ -4195,7 +4195,7 @@ if (!class_exists('Video')) {
$files = glob("{$filePath}*_thumbs*.jpg");
foreach ($files as $file) {
if (file_exists($file)) {
if($checkIfIsCorrupted && !isImageCorrupted($image_path)){
if($checkIfIsCorrupted && !isImageCorrupted($file)){
continue;
}
if ($doNotDeleteSprit && strpos($file, '_thumbsSprit.jpg') !== false) {