mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Request: Fix scene filter functionality
Previous functionality did not support groups.
This commit is contained in:
parent
9ca83e7570
commit
d04d42240a
@ -1,4 +1,5 @@
|
||||
#include "Request.h"
|
||||
#include "../../obs-websocket.h"
|
||||
#include "../../plugin-macros.generated.h"
|
||||
|
||||
json GetDefaultJsonObject(json requestData)
|
||||
@ -243,15 +244,23 @@ obs_source_t *Request::ValidateInput(const std::string keyName, RequestStatus::R
|
||||
|
||||
obs_sceneitem_t *Request::ValidateSceneItem(const std::string sceneKeyName, const std::string sceneItemIdKeyName, RequestStatus::RequestStatus &statusCode, std::string &comment, const ObsWebSocketSceneFilter filter) const
|
||||
{
|
||||
OBSSource sceneSource = ValidateScene(sceneKeyName, statusCode, comment, filter);
|
||||
obs_source_release(sceneSource);
|
||||
OBSSourceAutoRelease sceneSource = ValidateScene(sceneKeyName, statusCode, comment, filter);
|
||||
if (!sceneSource)
|
||||
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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user