Skip to content

Commit

Permalink
This should be an actual fix for the data migration issue. All settin…
Browse files Browse the repository at this point in the history
…gs may be reset in this update. Sorry for the inconvience
  • Loading branch information
mikedmor committed May 10, 2018
1 parent e27aba8 commit a6e2d62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion octoprint_multicam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ def get_assets(self):
def on_after_startup(self):
self._logger.info("MultiCam Loaded! (more: %s)" % self._settings.get(["multicamStream1"]))

def get_settings_version(self):
return 1

def on_settings_migrate(self, target, current=None):
if current is None or current < 1:
if current is None or current < self.get_settings_version():
self._logger.debug("Settings Migration Needed! Resetting to defaults!")
# Reset plug settings to defaults.
self._settings.set(['multicam_profiles'], self.get_settings_defaults()["multicam_profiles"])

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "OctoPrint-MultiCam"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "0.2.1"
plugin_version = "0.2.2"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit a6e2d62

Please sign in to comment.