mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
RequestHandler: Use ValidateScene2 in ValidateSceneItem
This commit is contained in:
parent
da83de7503
commit
430e61bef7
@ -297,23 +297,13 @@ obs_source_t *Request::ValidateInput(const std::string &keyName, RequestStatus::
|
||||
|
||||
obs_sceneitem_t *Request::ValidateSceneItem(const std::string &sceneKeyName, const std::string &sceneItemIdKeyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const ObsWebSocketSceneFilter filter) const
|
||||
{
|
||||
OBSSourceAutoRelease sceneSource = ValidateScene(sceneKeyName, statusCode, comment, filter);
|
||||
if (!sceneSource)
|
||||
OBSSceneAutoRelease scene = ValidateScene2(sceneKeyName, statusCode, comment, filter);
|
||||
if (!scene)
|
||||
return nullptr;
|
||||
|
||||
if (!ValidateNumber(sceneItemIdKeyName, statusCode, comment, 0))
|
||||
return nullptr;
|
||||
|
||||
OBSScene scene = obs_scene_from_source(sceneSource);
|
||||
if (!scene) {
|
||||
scene = obs_group_from_source(sceneSource);
|
||||
if (!scene) { // This should never happen
|
||||
statusCode = RequestStatus::GenericError;
|
||||
comment = "Somehow the scene was found but the scene object could not be fetched. Please report this to the obs-websocket developers.";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t sceneItemId = RequestData[sceneItemIdKeyName];
|
||||
|
||||
OBSSceneItem sceneItem = obs_scene_find_sceneitem_by_id(scene, sceneItemId);
|
||||
|
Loading…
Reference in New Issue
Block a user