Skip to content

Commit 53b60ba

Browse files
authored
Merge pull request #6 from remcoder/develop
0.2.1 - properly handle files in subfolders
2 parents 5676ea7 + 504e983 commit 53b60ba

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
Enriches the file list with a preview thumbnail for each gcode file.
44

5+
![image](https://user-images.githubusercontent.com/461650/58376079-2ec9a400-7f62-11e9-85e0-f48329dabb2c.png)
6+
57
## Use at your own risk
6-
This plugin uses some hack to what is otherwise impossible via the official API. This means that upgrading Octoprint or using other plugins will lead to all sorts of issues.
8+
This plugin uses some hacks to do what is otherwise impossible via the official API. This means that upgrading Octoprint or using other plugins could lead to issues.
79

810
## Setup
911

@@ -14,6 +16,9 @@ or manually using this URL:
1416

1517
## Changelog
1618

19+
0.2.1
20+
* properly handle files in subfolders
21+
1722
0.2.0
1823
* fixed detection of which gcode files are scrolled into view
1924
* added caching to avoid re-downloading gcode files

octoprint_gcodethumbs/static/js/gcode-preview-viewmodel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ $(function() {
8888
}
8989

9090
function enrichWithPreview(element) {
91-
const filename = extractKey(element);
91+
const path = self.filesViewModel.currentPath();
92+
const prefix = path ? path+'/' : '';
93+
const filename = prefix + extractKey(element);
9294

9395
if (previews[filename]) {
9496
insertAfter(previews[filename].canvas, element.querySelector('.title'));

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "GCode Thumbs"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "0.2.0"
17+
plugin_version = "0.2.1"
1818

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

0 commit comments

Comments
 (0)