Skip to content

Commit

Permalink
switch to quote from quote_plus to avoid + encoding of spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jneilliii committed Jan 11, 2022
1 parent 91b85b8 commit 02aea1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions octoprint_prusaslicerthumbnails/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)

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 = "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
Expand Down

0 comments on commit 02aea1c

Please sign in to comment.