From 02aea1ca34a46352925d4b615f7a9614e60cd51a Mon Sep 17 00:00:00 2001 From: jneilliii Date: Mon, 10 Jan 2022 22:37:27 -0500 Subject: [PATCH] switch to quote from quote_plus to avoid `+` encoding of spaces --- octoprint_prusaslicerthumbnails/__init__.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/octoprint_prusaslicerthumbnails/__init__.py b/octoprint_prusaslicerthumbnails/__init__.py index 913db1d..2ac230c 100644 --- a/octoprint_prusaslicerthumbnails/__init__.py +++ b/octoprint_prusaslicerthumbnails/__init__.py @@ -14,9 +14,9 @@ import base64 try: - from urllib import quote_plus + from urllib import quote except ImportError: - from urllib.parse import quote_plus + from urllib.parse import quote class PrusaslicerthumbnailsPlugin(octoprint.plugin.SettingsPlugin, @@ -184,7 +184,7 @@ def on_event(self, event, payload): gcode_filename = self._file_manager.path_on_disk("local", payload["path"]) self._extract_thumbnail(gcode_filename, thumbnail_filename) if os.path.exists(thumbnail_filename): - thumbnail_url = "plugin/prusaslicerthumbnails/thumbnail/{}?{:%Y%m%d%H%M%S}".format(thumbnail_path.replace(thumbnail_name, quote_plus(thumbnail_name)), datetime.datetime.now()) + thumbnail_url = "plugin/prusaslicerthumbnails/thumbnail/{}?{:%Y%m%d%H%M%S}".format(thumbnail_path.replace(thumbnail_name, quote(thumbnail_name)), datetime.datetime.now()) self._file_manager.set_additional_metadata("local", payload["path"], "thumbnail", thumbnail_url.replace("//", "/"), overwrite=True) self._file_manager.set_additional_metadata("local", payload["path"], "thumbnail_src", self._identifier, overwrite=True) diff --git a/setup.py b/setup.py index 89c48fd..2558d7f 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "Slicer Thumbnails" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.0.1rc1" +plugin_version = "1.0.1rc2" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module