bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Streamdeck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.53k stars 498 forks source link

Remove option to leave spaces in labels for instances #2145

Closed JeffreyDavidsz closed 1 year ago

JeffreyDavidsz commented 1 year ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

When using a space in an instance name, variable start doing weird stuff (qlab instance for example)

Steps To Reproduce

load module put space in name see is remaining time works

Expected Behavior

should work

Environment (please complete the following information)

- OS: OSX
- Browser: Firefox
- Companion Version: 2.3.0

Additional context

No response

Julusian commented 1 year ago

We should probably be more restrictive than just blocking spaces. I expect $(): will all also mess up our variable interpretation.

Could be worth looking into splitting label into 'label' and 'id'. id being used for variables, (needs a better name internally, we already have a non-friendly id), and label used for display only.

JeffreyDavidsz commented 1 year ago

Just regex it to letters and numbers? for example ^[a-zA-Z0-9_.-]*$ ?

dnmeid commented 1 year ago

+1 for the regex, but there should be at least one char

Julusian commented 1 year ago

yeah Ill look into this for 3.0 I did something similar in 3.0 for the variable names coming from modules, as I realised they had the same flaw. But that was a safer change

Julusian commented 1 year ago

haha, that was a good idea to look into this. I realised that in 3.0 it was possible to set an instance to have the label internal which unsurprisingly causes a few issues.

I've fixed this and added the regex in 3.0, and it will fix up existing data as part of the upgrade and import process.

istnv commented 1 year ago

Looks like this is affecting VLC as well.