mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Merge pull request #301 from Palakis/bugfix/233-setrecordingfolder-not-working
SetRecordingFolder: fix docs + simplify helper function
This commit is contained in:
commit
86d3925bf4
@ -419,17 +419,13 @@ const char* Utils::GetRecordingFolder() {
|
||||
|
||||
bool Utils::SetRecordingFolder(const char* path) {
|
||||
QDir dir(path);
|
||||
if (!dir.exists())
|
||||
if (!dir.exists()) {
|
||||
dir.mkpath(".");
|
||||
}
|
||||
|
||||
config_t* profile = obs_frontend_get_profile_config();
|
||||
QString outputMode = config_get_string(profile, "Output", "Mode");
|
||||
|
||||
if (outputMode == "Advanced") {
|
||||
config_set_string(profile, "AdvOut", "RecFilePath", path);
|
||||
} else {
|
||||
config_set_string(profile, "SimpleOutput", "FilePath", path);
|
||||
}
|
||||
config_set_string(profile, "AdvOut", "RecFilePath", path);
|
||||
config_set_string(profile, "SimpleOutput", "FilePath", path);
|
||||
|
||||
config_save(profile);
|
||||
return true;
|
||||
|
@ -56,8 +56,14 @@ HandlerResponse WSRequestHandler::HandleStartRecording(WSRequestHandler* req) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the current recording folder.
|
||||
*
|
||||
* In the current profile, sets the recording folder of the Simple and Advanced
|
||||
* output modes to the specified value.
|
||||
*
|
||||
* Please note: if `SetRecordingFolder` is called while a recording is
|
||||
* in progress, the change won't be applied immediately and will be
|
||||
* effective on the next recording.
|
||||
*
|
||||
*
|
||||
* @param {String} `rec-folder` Path of the recording folder.
|
||||
*
|
||||
* @api requests
|
||||
|
Loading…
x
Reference in New Issue
Block a user