mikedmor / OctoPrint_MultiCam

Extends the Control tab of OctoPrint, allowing the ability to switch between multiple webcam feeds.
45 stars 19 forks source link

Add snapshot_url and make the data available to other plugins #22

Closed fabianonline closed 2 years ago

fabianonline commented 4 years ago

Hi.

This pull requests does two things:

The field snapshot_url isn't used by this plugin, but there are (at least one) other plugins using this value. But without it being available elsewhere, there are two possibilities:

Since pretty much every user using more than one webcam is going to use this plugin, I think it is the right place to have that setting as well.

Via the new helper get_webcams, other plugins can easily get that data without having to do other work such as falling back to reading the values from octoprint for the default webcam - the helper returns a "clean" array, with the data for the first webcam correctly filled out.

mikedmor commented 3 years ago

Thanks for the help, but it would seem there are conflicts with this and the base. If you don't mind resolving those I will gladly merge your changes into the base.