Skip to content

Commit

Permalink
fix: invalid preset data, text sources not appearing (#290)
Browse files Browse the repository at this point in the history
* fix: invalid preset steps data

* chore: update dependencies

* fix: prevent duplicates when adding new inputs in scene

* chore: version up, changelog
  • Loading branch information
bryce-seifert authored Sep 22, 2024
1 parent 4d07c93 commit e4134f7
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 365 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ See [HELP.md](https://github.com/bitfocus/companion-module-obs-studio/blob/maste

## Changelog

### v3.9.1

- Fix
- Adding new text sources would not populate in action dropdowns if Companion was already open
- Text and Media sources would occasionally be duplicated in the dropdown list
- Invalid preset steps would cause issues with Bitfocus Buttons

### v3.9.0

- New
Expand Down
14 changes: 10 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1249,22 +1249,28 @@ class OBSInstance extends InstanceBase {
this.setVariableValues({
[`current_text_${name}`]: `Text from file: ${inputSettings.text_file ?? inputSettings.file}`,
})
} else if (inputSettings?.text) {
this.textSourceList.push({ id: sourceName, label: sourceName })
} else {
if (!this.textSourceList.find((item) => item.id === sourceName)) {
this.textSourceList.push({ id: sourceName, label: sourceName })
}
this.setVariableValues({
[`current_text_${name}`]: inputSettings.text ?? '',
})
}
break
case 'ffmpeg_source':
case 'vlc_source':
this.mediaSourceList.push({ id: sourceName, label: sourceName })
if (!this.mediaSourceList.find((item) => item.id === sourceName)) {
this.mediaSourceList.push({ id: sourceName, label: sourceName })
}
if (!this.mediaPoll) {
this.startMediaPoll()
}
break
case 'image_source':
this.imageSourceList.push({ id: sourceName, label: sourceName })
if (!this.imageSourceList.find((item) => item.id === sourceName)) {
this.imageSourceList.push({ id: sourceName, label: sourceName })
}
break
default:
break
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obs-studio",
"version": "3.9.0",
"version": "3.9.1",
"main": "index.js",
"type": "module",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"url": "git+https://github.com/bitfocus/companion-module-obs-studio.git"
},
"devDependencies": {
"@companion-module/tools": "^2.0.2",
"@companion-module/tools": "^2.0.4",
"prettier": "^3.3.3"
},
"prettier": "@companion-module/tools/.prettierrc.json"
Expand Down
14 changes: 12 additions & 2 deletions presets.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,12 @@ export function getPresets() {
color: ColorWhite,
bgcolor: 0,
},
steps: [{}],
steps: [
{
down: [],
up: [],
},
],
feedbacks: [],
}

Expand All @@ -429,7 +434,12 @@ export function getPresets() {
color: ColorWhite,
bgcolor: 0,
},
steps: [{}],
steps: [
{
down: [],
up: [],
},
],
feedbacks: [
{
feedbackId: 'freeDiskSpaceRemaining',
Expand Down
Loading

0 comments on commit e4134f7

Please sign in to comment.