Merge pull request #301 from Palakis/bugfix/233-setrecordingfolder-not-working

SetRecordingFolder: fix docs + simplify helper function
This commit is contained in:
Stéphane Lepin 2019-04-21 10:13:07 +02:00 committed by GitHub
commit 86d3925bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -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;

View File

@ -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