1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

Show active lives in the API

This commit is contained in:
Daniel 2022-03-11 10:11:57 -03:00
parent e025be82fd
commit dc8df66e59

View file

@ -652,6 +652,7 @@ class API extends PluginAbstract {
$obj->livestream["joinURL"] = Live::getLinkToLiveFromUsers_idAndLiveServer($user->getBdId(), $obj->livestream["live_servers_id"]);
$obj->livestream["activeLives"] = array();
$obj->livestream["latestLives"] = array();
$rows = LiveTransmitionHistory::getActiveLiveFromUser($parameters['users_id'], '','', 100);
@ -662,6 +663,13 @@ class API extends PluginAbstract {
$obj->livestream["activeLives"][] = $value;
}
$rows = LiveTransmitionHistory::getLastsLiveHistoriesFromUser($parameters['users_id'], 100);
foreach ($rows as $value) {
$value['live_transmitions_history_id'] = $value['id'];
$obj->livestream["latestLives"][] = $value;
}
return new ApiObject("", false, $obj);
} else {
return new ApiObject("API Secret is not valid");