Giter VIP home page Giter VIP logo

Comments (2)

jstarpl avatar jstarpl commented on June 18, 2024

Yeah, this is a good point. Currently, our Peripheral Device API has no concept of default settings, and I think that's the reason everything is default-off - because it's undefined. I guess the solution would be to come up with a way of having some default settings - the question is, how should they be handled? I suppose one way of doing it would be to allow the peripheral device to expose a defaultConfig object, that would be valid for the configManifest schema, and then later that would be copied over to the settings property if this is the first connection of the device.

I don't think anything more can be done, without the Peripheral Device itself holding some sort of migration logic to migrate the settings object. The best we could do would be to provide some warning if the current settings do not match the new manifest. I also don't think we could do anything if the defaults change. I don't think an infrastructure as complicated as the one we have for ShowStyles or Blueprint configs would be viable here.

from sofie-core.

Julusian avatar Julusian commented on June 18, 2024

We are populating default values for playout-gateway subdevices https://github.com/nrkno/sofie-core/blob/release50/packages/playout-gateway/src/tsrHandler.ts#L655-L661
And we do provide a utility to parse the defaults from the json-schema https://github.com/nrkno/sofie-core/blob/release50/packages/shared-lib/src/lib/JSONSchemaUtil.ts#L49.

So it wouldn't be too hard to on the fly do a deep-merge of the db config on top of the defaults. I don't know whether it would be better to do this in core of the gateway itself. Im not sure if we need to worry about saving the defaults into the database, as the ui may already present the defaults as defined in the schema when it encounters an undefined

from sofie-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.