bitfocus / companion-module-getontime-ontime

MIT License
8 stars 5 forks source link

Event indexing 0 or 1 ? #60

Closed alex-Arc closed 6 months ago

alex-Arc commented 6 months ago

The object selectedEventIndex is ofcorece zero based internally but all out receiving ws API's expect 1 based

Should we +1 to the companion variable selectedEventIndex so that if the user send back this value it will have the same result?

alex-Arc commented 6 months ago

@lukestein your input here would also be welcome

lukestein commented 6 months ago

Oh that's a good catch. Definitely seems like it should be consistently either 0-based or 1-based.

Is there anywhere in the UI that indices are shown? These seem to be the two places in Companion that they show up, but I realize there may be lots of other ways to hit APIs

image

My gut would have said that if starting from scratch, run all the APIs using the same indexing (0-based?) as the internal implementation. But if all the APIs are already 1-based, then +1 on the Companion variable seems like a good solution.

alex-Arc commented 6 months ago

Yeah the UI is 1-based image

lukestein commented 6 months ago

Oh yeah. Then would def add one to the selectedEventIndex Companion variable and make everything external 1-based.