1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Option to auto create MP3 on ne videos upload

This commit is contained in:
Daniel Neto 2024-07-13 21:40:42 -03:00
parent 917e142d92
commit e2bc9e6b00
2 changed files with 18 additions and 1 deletions

View file

@ -45,7 +45,7 @@ function convertVideoToMP3FileIfNotExists($videos_id)
if (empty($video)) {
return false;
}
$types = ['video', 'audio'];
$types = [Video::$videoTypeVideo, Video::$videoTypeAudio];
if (!in_array($video['type'], $types)) {
return false;
}

View file

@ -483,6 +483,9 @@ Disallow: *action=tagsearch*
$obj->videosForKids = true;
$obj->autoConvertVideosToMP3 = false;
return $obj;
}
@ -555,6 +558,10 @@ Disallow: *action=tagsearch*
}
$obj = $this->getDataObject();
if($obj->autoConvertVideosToMP3){
convertVideoToMP3FileIfNotExists($videos_id);
}
$video = Video::getVideo($videos_id, Video::SORT_TYPE_VIEWABLE, true);
if (!empty($video['rrating']) && empty($_GET['rrating'])) {
$suffix = strtoupper(str_replace("-", "", $video['rrating']));
@ -667,6 +674,16 @@ Disallow: *action=tagsearch*
return true;
}
public function afterNewVideo($videos_id) {
$obj = AVideoPlugin::getDataObject('CustomizeAdvanced');
if($obj->autoConvertVideosToMP3){
convertVideoToMP3FileIfNotExists($videos_id);
}
return false;
}
public static function getManagerVideosAddNew() {
global $global;
$filename = $global['systemRootPath'] . 'plugin/CustomizeAdvanced/getManagerVideosAddNew.js';