mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
This commit is contained in:
parent
4f8e3d674f
commit
00c895068c
1 changed files with 29 additions and 0 deletions
29
install/deleteThumbsFiles.php
Normal file
29
install/deleteThumbsFiles.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
//streamer config
|
||||
require_once '../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'objects/video.php';
|
||||
|
||||
if (!isCommandLineInterface()) {
|
||||
return die('Command Line only');
|
||||
}
|
||||
|
||||
$users_ids = array();
|
||||
$sql = "SELECT * FROM videos ";
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
$total = count($fullData);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
$count = 0;
|
||||
foreach ($fullData as $key => $row) {
|
||||
$count++;
|
||||
$filename = $row['filename'];
|
||||
Video::deleteThumbs($filename, true);
|
||||
echo "{$total}/{$count} Thumbs deleted from {$row['title']}".PHP_EOL;
|
||||
ob_flush();
|
||||
}
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue