diff --git a/install/cleanup_downloads.php b/install/cleanup_downloads.php index 5a2d754af8..7003c5b277 100644 --- a/install/cleanup_downloads.php +++ b/install/cleanup_downloads.php @@ -4,5 +4,5 @@ require_once __DIR__.'/../videos/configuration.php'; if (!isCommandLineInterface()) { return die('Command Line only'); } - +$global['printLogs'] = 1; cleanupDownloadsDirectory(); \ No newline at end of file diff --git a/objects/functionsFFMPEG.php b/objects/functionsFFMPEG.php index 3c4e077cc9..bfb2dc0cef 100644 --- a/objects/functionsFFMPEG.php +++ b/objects/functionsFFMPEG.php @@ -118,6 +118,7 @@ function cleanupDownloadsDirectory($resolution = 720) // Check if it's a file and does not match the resolution pattern (e.g., '480_.mp4') if (is_file($filePath) && (preg_match('/' . $resolution . '_\.mp4$/', $entry) || empty(filesize($filePath)))) { // Attempt to delete the file + if (unlink($filePath)) { _error_log("cleanupDownloadsDirectory: Deleted file: {$filePath}"); } else { diff --git a/objects/functionsLogs.php b/objects/functionsLogs.php index d2f024b3ac..3540a830d9 100644 --- a/objects/functionsLogs.php +++ b/objects/functionsLogs.php @@ -89,7 +89,7 @@ function _error_log($message, $type = 0, $doNotRepeat = false) if (!is_string($message)) { $message = json_encode($message); } - if (isSchedulerRun()) { + if (isSchedulerRun() || !empty($global['printLogs'])) { echo $message . PHP_EOL; return false; }