noobs 0.0.180 → 0.0.184

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
package/dist/noobs.node CHANGED
Binary file
package/index.d.ts CHANGED
@@ -158,10 +158,7 @@ export type SourceDimensions = {
158
158
  width: number; // Width in pixels, before scaling
159
159
  };
160
160
 
161
- export enum FileExtension {
162
- MP4,
163
- MKV,
164
- }
161
+ export type FileExtension = 'mp4' | 'mkv';
165
162
 
166
163
  interface Noobs {
167
164
  Init(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noobs",
3
- "version": "0.0.180",
3
+ "version": "0.0.184",
4
4
  "description": "A native Node.js addon with libobs bindings for Warcraft Recorder.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/src/main.cpp CHANGED
@@ -44,7 +44,7 @@ Napi::Value ObsSetRecordingCfg(const Napi::CallbackInfo& info) {
44
44
  return info.Env().Undefined();
45
45
  }
46
46
 
47
- bool valid = info.Length() == 2 && info[0].IsString() && info[1].IsNumber();
47
+ bool valid = info.Length() == 2 && info[0].IsString() && info[1].IsString();
48
48
 
49
49
  if (!valid) {
50
50
  Napi::TypeError::New(info.Env(), "Invalid arguments passed to ObsSetRecordingCfg").ThrowAsJavaScriptException();
@@ -52,14 +52,9 @@ Napi::Value ObsSetRecordingCfg(const Napi::CallbackInfo& info) {
52
52
  }
53
53
 
54
54
  std::string recordingPath = info[0].As<Napi::String>().Utf8Value();
55
- int fileExt = info[1].As<Napi::Number>().Int32Value();
56
- std::string fileExtension;
57
-
58
- if (fileExt == 0) {
59
- fileExtension = "mp4";
60
- } else if (fileExt == 1) {
61
- fileExtension = "mkv";
62
- } else {
55
+ std::string fileExtension = info[1].As<Napi::String>().Utf8Value();
56
+
57
+ if (fileExtension != "mp4" && fileExtension != "mkv") {
63
58
  Napi::TypeError::New(info.Env(), "Invalid file extension value").ThrowAsJavaScriptException();
64
59
  return info.Env().Undefined();
65
60
  }