1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
This commit is contained in:
Daniel Neto 2023-03-14 16:49:56 -03:00
parent 948d61ada5
commit ddfdab435e
2 changed files with 7 additions and 1 deletions

View file

@ -950,6 +950,8 @@ if (!class_exists('Video')) {
} else {
$sql .= " AND v.type = '{$_SESSION['type']}' ";
}
} else if (!empty($_REQUEST['videoType']) && $_REQUEST['videoType'] == 'audio_and_video') {
$sql .= " AND (v.type = 'audio' OR v.type = 'video') ";
} else if (!empty($_REQUEST['videoType']) && in_array($_REQUEST['videoType'], self::$typeOptions)) {
$sql .= " AND v.type = '{$_REQUEST['videoType']}' ";
}
@ -1400,6 +1402,8 @@ if (!class_exists('Video')) {
$sql .= " AND v.type != 'article' ";
} else if (!empty($type)) {
$sql .= " AND v.type = '{$type}' ";
} else if (!empty($_REQUEST['videoType']) && $_REQUEST['videoType'] == 'audio_and_video') {
$sql .= " AND (v.type = 'audio' OR v.type = 'video') ";
} else if (!empty($_REQUEST['videoType']) && in_array($_REQUEST['videoType'], self::$typeOptions)) {
$sql .= " AND v.type = '{$_REQUEST['videoType']}' ";
}
@ -2040,6 +2044,8 @@ if (!class_exists('Video')) {
$sql .= " AND v.type != 'article' ";
} else if (!empty($type)) {
$sql .= " AND v.type = '{$type}' ";
} else if (!empty($_REQUEST['videoType']) && $_REQUEST['videoType'] == 'audio_and_video') {
$sql .= " AND (v.type = 'audio' OR v.type = 'video') ";
} else if (!empty($_REQUEST['videoType']) && in_array($_REQUEST['videoType'], self::$typeOptions)) {
$sql .= " AND v.type = '{$_REQUEST['videoType']}' ";
}

View file

@ -461,7 +461,7 @@ class API extends PluginAbstract {
* ['catName' the clean_APIName of the category you want to filter]
* ['channelName' the channelName of the videos you want to filter]
* ['playlist' use playlist=1 to get a response compatible with the playlist endpoint]
* ['videoType' the type of the video, the valid options are 'audio', 'video', 'embed', 'linkVideo', 'linkAudio', 'torrent', 'pdf', 'image', 'gallery', 'article', 'serie', 'image', 'zip', 'notfound', 'blockedUser']
* ['videoType' the type of the video, the valid options are 'audio_and_video', 'audio', 'video', 'embed', 'linkVideo', 'linkAudio', 'torrent', 'pdf', 'image', 'gallery', 'article', 'serie', 'image', 'zip', 'notfound', 'blockedUser']
* ['is_serie' if is 0 return only videos, if is 1 return only series, if is not set, return all]
* @example {webSiteRootURL}plugin/API/{getOrSet}.json.php?APIName={APIName}&catName=default&rowCount=10
* @example Suggested ----> {webSiteRootURL}plugin/API/get.json.php?APIName={APIName}&rowCount=10&sort[suggested]=1