mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 02:39:46 +02:00
This commit is contained in:
parent
95d3dfc895
commit
8a6a1f448b
9 changed files with 108 additions and 28 deletions
|
@ -1089,4 +1089,25 @@ function getVideosDirectoryUsageInfo() {
|
|||
'used_percentage' => $usedPercentageFormatted,
|
||||
'used_percentage_number' => $usedPercentage
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
function findMP4File($folderPath)
|
||||
{
|
||||
// Ensure the folder path ends with a slash
|
||||
$folderPath = addLastSlash($folderPath);
|
||||
|
||||
// Open the folder and iterate over files
|
||||
if (is_dir($folderPath)) {
|
||||
$files = scandir($folderPath);
|
||||
foreach ($files as $file) {
|
||||
// Check if the file has a .mp4 extension
|
||||
if (pathinfo($file, PATHINFO_EXTENSION) === 'mp4') {
|
||||
// Return the absolute path to the first .mp4 file found
|
||||
return $folderPath . $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return false if no .mp4 file is found
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue