diff --git a/.versioneer-lookup b/.versioneer-lookup index 182f06954..65754b7df 100644 --- a/.versioneer-lookup +++ b/.versioneer-lookup @@ -29,10 +29,10 @@ improve/.* 1.10.0 cd955e9a46782119b36cc22b8dea5652ebbf9774 pep440-dev staging/bugfix 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev bug/.* 1.8.8 8e4c1f5246c4245b839ccdcdabf2beee671b08d7 pep440-dev -# staging/maintenance is currently the branch for preparation of 1.9.0rc4 +# staging/maintenance is currently the branch for preparation of 1.9.0rc5 # so is regressionfix/... -staging/maintenance 1.9.0rc4 ed798e4c6f473ed15bfd8ff583f3913b18ab716c pep440-dev -regressionfix/.* 1.9.0rc4 ed798e4c6f473ed15bfd8ff583f3913b18ab716c pep440-dev +staging/maintenance 1.9.0rc5 c5b5af3c1c483a3952c686564a1075531e88bf8c pep440-dev +regressionfix/.* 1.9.0rc5 c5b5af3c1c483a3952c686564a1075531e88bf8c pep440-dev # staging/devel is currently inactive (but has the 1.4.1rc4 namespace) staging/devel 1.4.1rc4 650d54d1885409fa1d411eb54b9e8c7ff428910f pep440-dev diff --git a/SUPPORTERS.md b/SUPPORTERS.md index 923eb0504..1cb8ed752 100644 --- a/SUPPORTERS.md +++ b/SUPPORTERS.md @@ -9,7 +9,6 @@ thanks to everyone who contributed! * 3D-TECH * 3DPrinterOS * Al Mucci - * Arnljot Arntsen * Ash King * Ben Fritsch * BigTreeTech @@ -19,7 +18,6 @@ thanks to everyone who contributed! * Christian Wolf * Christian Würthner * Christoph Sigrist - * CooperSpartan * Creality3D * DeltaMaker 3D Printers * Dennis Breining @@ -29,10 +27,8 @@ thanks to everyone who contributed! * Franziska Kunsmann * Hog Duske * Jacob Renstrom - * James Mackay * Jeff Green * Jeff Moe - * jeffiel * Jeremy Cole * John Cassel * Julian Melo @@ -44,11 +40,12 @@ thanks to everyone who contributed! * Lachlan Bell * Lefteris Lertas * LulzBot + * Makerbase * Makespace Madrid * Mark Greenwald * Mark Walker * Michael Aumock - * Mike Kershaw + * Michael Badagliacco * Mosaic Manufacturing * Norman Jaffe * Obico @@ -59,15 +56,13 @@ thanks to everyone who contributed! * Randy C. Will * Ranjib Dey * Richard McGuire - * Richard Michaud * Richard Stocks * Robert Gusek - * Sean Jensen-Grey - * Sebastien Andrivet * SimplyPrint + * Songyin Zheng * Stefan Krister * Steve Dougherty * Steve Thompson * Ulrich Kempken -and 2041 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)! +and 2025 more wonderful people pledging on the [Patreon campaign](https://patreon.com/foosel) or via [GitHub Sponsors](https://github.com/users/foosel/sponsorship)! diff --git a/setup.py b/setup.py index 968013229..47cb1349b 100644 --- a/setup.py +++ b/setup.py @@ -48,37 +48,37 @@ core_deps = [ "feedparser>=6.0.10,<7", "filetype>=1.2.0,<2", "Flask-Assets>=2.0,<3", - "Flask-Babel>=3.0.1,<4", + "Flask-Babel>=3.1.0,<4", "Flask-Login>=0.6.2,<0.7", # breaking changes can happen on minor version increases "Flask-Limiter>=3.3.0,<4", "flask>=2.2.3,<2.3", # breaking changes can happen on minor version increases (with deprecation warnings) - "frozendict>=2.3.5,<3", + "frozendict>=2.3.7,<3", "future>=0.18.3,<1", # not really needed anymore, but leaving in for py2/3 compat plugins - "markdown>=3.4.1,<4", + "markdown>=3.4.3,<4", "netaddr>=0.8,<0.9", # changelog hints at breaking changes on minor version increases "netifaces2>=0.0.14,<0.1", "passlib>=1.7.4,<2", "pathvalidate>=2.5.2,<3", "pkginfo>=1.9.6,<2", "psutil>=5.9.4,<6", - "pydantic>=1.10.5,<2", + "pydantic>=1.10.7,<2", "pylru>=1.2.1,<2", "pyserial>=3.5,<4", "PyYAML>=5.4.1,<6", # no changelog available for version 6, so we're not risking it "requests>=2.28.2,<3", "sarge==0.1.7.post1", "semantic_version>=2.10.0,<3", - "sentry-sdk>=1.16.0,<2", + "sentry-sdk>=1.19.1,<2", "tornado>=6.2,<7", "watchdog>=2.3.1,<3", "websocket-client>=1.5.1,<2", "werkzeug>=2.2.3,<2.3", # breaking changes can happen on minor version increases "wrapt>=1.15,<1.16", "zeroconf==0.39.4", # final version to include universal wheel, later takes ages to compiles on rpi, piwheels has no wheels for latest either - "zipstream-ng>=1.4.0,<2.0.0", + "zipstream-ng>=1.5.0,<2.0.0", ] vendored_deps = [ - "blinker>=1.5,<2", # dependency of flask_principal + "blinker>=1.6.1,<2", # dependency of flask_principal "class-doc>=0.2.6,<0.3", # dependency of with_attrs_docs "regex", # dependency of awesome-slugify "unidecode", # dependency of awesome-slugify @@ -102,7 +102,7 @@ EXTRA_REQUIRES = { "ddt", "mock>=5.0.1,<6", "pytest-doctest-custom>=1.0.0,<2", - "pytest>=7.2.2,<8", + "pytest>=7.3.0,<8", # pre-commit "pre-commit", # profiler diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index f6f7b835e..9a4de08d0 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -2346,6 +2346,8 @@ class ProgressPlugin(OctoPrintPlugin): class WebcamProviderPlugin(OctoPrintPlugin): """ The ``WebcamProviderPlugin`` can be used to provide one or more webcams visible on the frontend and used for snapshots/timelapses. + + For an example of how to utilize this, see the bundled ``classicwebcam`` plugin, or the ``testpicture`` plugin available `here `_. """ def get_webcam_configurations(self): diff --git a/src/octoprint/plugins/classicwebcam/__init__.py b/src/octoprint/plugins/classicwebcam/__init__.py index 048fde57b..f45aed491 100644 --- a/src/octoprint/plugins/classicwebcam/__init__.py +++ b/src/octoprint/plugins/classicwebcam/__init__.py @@ -134,7 +134,7 @@ class ClassicWebcamPlugin( snapshot_url, stream=True, timeout=self._settings.get_int(["snapshotTimeout"]), - verify=self._settings.get_boolean(["rosnapshotSslValidationtate90"]), + verify=self._settings.get_boolean(["snapshotSslValidation"]), ) r.raise_for_status() return r.iter_content(chunk_size=1024) diff --git a/src/octoprint/plugins/classicwebcam/static/js/classicwebcam.js b/src/octoprint/plugins/classicwebcam/static/js/classicwebcam.js index f1b99522a..70d610fcf 100644 --- a/src/octoprint/plugins/classicwebcam/static/js/classicwebcam.js +++ b/src/octoprint/plugins/classicwebcam/static/js/classicwebcam.js @@ -54,7 +54,7 @@ $(function () { }); }; - self.onWebcamVisbilityChange = function (visible) { + self.onWebcamVisibilityChange = function (visible) { self.webcamStreamVisible = visible; if (self.webcamStreamVisible) { self._enableWebcam(); diff --git a/src/octoprint/plugins/errortracking/__init__.py b/src/octoprint/plugins/errortracking/__init__.py index dcd59658b..59db22d9f 100644 --- a/src/octoprint/plugins/errortracking/__init__.py +++ b/src/octoprint/plugins/errortracking/__init__.py @@ -18,10 +18,10 @@ from octoprint.util.version import ( ) SENTRY_URL_SERVER = ( - "https://cb1ee590a2f34baca47dd207d7f294d5@o118517.ingest.sentry.io/1373987" + "https://1af1a737d9684867859b6baec346addd@o118517.ingest.sentry.io/1373987" ) SENTRY_URL_COREUI = ( - "https://a32c80a4a282468d8d41fc2accb77088@o118517.ingest.sentry.io/1374096" + "https://9823e9176ee54cf385e31cbbef50dda7@o118517.ingest.sentry.io/1374096" ) SETTINGS_DEFAULTS = { diff --git a/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js b/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js index 5b49120f8..0b9e71df9 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/gcodeviewer.js @@ -345,8 +345,6 @@ $(function () { self.currentlyPrinting = false; - self.errorCount = 0; - self.layerSlider = undefined; self.layerCommandSlider = undefined; @@ -510,7 +508,12 @@ $(function () { self.loadFile = function (path, date, size) { self.enableReload(false); self.needsLoad = false; - if (self.status === "idle" && self.errorCount < 3) { + if ( + self.status === "idle" && + self.cachedPath !== path && + self.cachedDate !== date && + self.cachedSize !== size + ) { self.status = "request"; self.cachedPath = path; @@ -609,7 +612,6 @@ $(function () { ) { self._renderPercentage(data.progress.completion); } - self.errorCount = 0; } else { if (self.status === "idle") self.clear(); if ( diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js index 5fca079b1..18c0f8b70 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/reader.js @@ -127,7 +127,10 @@ GCODE.gCodeReader = (function () { if (key == null) return {layer: cachedLayer, cmd: cachedCmd}; var layer = searchInLayers(0, rendererModel.length - 1, key); - var cmd = searchInCmds(layer, 0, GCODE.renderer.getLayer(layer).length - 1, key); + var cmds = GCODE.renderer.getLayer(layer); + if (cmds === undefined) return undefined; + + var cmd = searchInCmds(layer, 0, cmds.length - 1, key); // remember last position cachedLayer = layer; diff --git a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js index c1be5700c..5ab1e537e 100644 --- a/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js +++ b/src/octoprint/plugins/gcodeviewer/static/js/viewer/worker.js @@ -353,7 +353,7 @@ var gCodeLineGenerator = async function* (fileURL) { const reader = response.body.getReader(); // we use these two variables to calculate the percentage. - var totalDownloadLength = response.headers.get("content-length"); + var totalDownloadLength = response.headers.get("X-Original-Content-Length"); var currentDownloadLength = 0; // lets read a first data chunk diff --git a/src/octoprint/schema/config/webcam.py b/src/octoprint/schema/config/webcam.py index 1f3c87338..8f6bd7567 100644 --- a/src/octoprint/schema/config/webcam.py +++ b/src/octoprint/schema/config/webcam.py @@ -78,3 +78,6 @@ class WebcamConfig(BaseModel): defaultWebcam: str = "classic" """The name of the default webcam""" + + snapshotWebcam: str = "classic" + """The name of the default webcam to use for snapshots""" diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py index 54df6a6f4..11f87c50e 100644 --- a/src/octoprint/server/api/settings.py +++ b/src/octoprint/server/api/settings.py @@ -15,6 +15,7 @@ from octoprint.server import pluginManager, printer, userManager from octoprint.server.api import api from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking from octoprint.settings import settings, valid_boolean_trues +from octoprint.timelapse import configure_timelapse from octoprint.webcams import ( get_default_webcam, get_snapshot_webcam, @@ -639,6 +640,9 @@ def _saveSettings(data): if "snapshotWebcam" in data["webcam"]: s.set(["webcam", "snapshotWebcam"], data["webcam"]["snapshotWebcam"]) + # timelapse needs to be reconfigured now since it depends on the current snapshot webcam + configure_timelapse() + if "feature" in data: if "temperatureGraph" in data["feature"]: s.setBoolean( diff --git a/src/octoprint/server/util/tornado.py b/src/octoprint/server/util/tornado.py index b4be6a6d9..89e41e9c6 100644 --- a/src/octoprint/server/util/tornado.py +++ b/src/octoprint/server/util/tornado.py @@ -1192,6 +1192,8 @@ class LargeResponseHandler( self.set_header("Cache-Control", "max-age=0, must-revalidate, private") self.set_header("Expires", "-1") + self.set_header("X-Original-Content-Length", str(self.get_content_size())) + @property def original_absolute_path(self): """The path of the uncompressed file corresponding to the compressed file""" diff --git a/src/octoprint/static/js/app/viewmodels/control.js b/src/octoprint/static/js/app/viewmodels/control.js index 84e7c3615..107d28c6d 100644 --- a/src/octoprint/static/js/app/viewmodels/control.js +++ b/src/octoprint/static/js/app/viewmodels/control.js @@ -66,16 +66,35 @@ $(function () { console.debug( `VM for webcam #${target.id} not found, skipping visibility update` ); - } else if (typeof vm.onWebcamVisbilityChange === "function") { - vm.onWebcamVisbilityChange(visible); + } else if (typeof vm.onWebcamVisibilityChange === "function") { + vm.onWebcamVisibilityChange(visible); } else { console.debug( - `VM for webcam #${target.id} does not declare 'onWebcamVisbilityChange(visible)', skipping visibility update (vm=${vm.constructor.name})` + `VM for webcam #${target.id} does not declare 'onWebcamVisibilityChange(visible)', skipping visibility update (vm=${vm.constructor.name})` ); } }; + const selectedCameraStorageKey = "core.control.selectedCamera"; + self.selectDefaultWebcam = function () { + let div = localStorage[selectedCameraStorageKey]; + + if (!div || document.getElementById(div.slice(1)) === null) { + div = undefined; + } + + if (div !== undefined) { + $(`${div}_link a`).tab("show"); + } else { + $("#webcam_plugins_container .nav li:first a").tab("show"); + } + }; + self.onStartupComplete = function () { + $("#webcam_plugins_container .nav a[data-toggle='tab']").on("shown", (e) => { + localStorage[selectedCameraStorageKey] = e.target.hash; + }); + self.selectDefaultWebcam(); self.recreateIntersectionObservers(); }; @@ -84,7 +103,7 @@ $(function () { // A webcam will not intersect with the control tab if the control tab is invisible because another tab // is selected or if the webcam isn't shown because another webcam is active. // - // Whenever the webacam changes visibility we will call onWebcamVisbilityChange() which the webcam's + // Whenever the webacam changes visibility we will call onWebcamVisibilityChange() which the webcam's // VM can use to start or stop the stream. self.intersectionObservers.forEach(function (observer) { observer.disconnect(); diff --git a/src/octoprint/static/js/app/viewmodels/timelapse.js b/src/octoprint/static/js/app/viewmodels/timelapse.js index 414c2aaad..62033defb 100644 --- a/src/octoprint/static/js/app/viewmodels/timelapse.js +++ b/src/octoprint/static/js/app/viewmodels/timelapse.js @@ -710,7 +710,7 @@ $(function () { var html = "

" + gettext( - "Failed repeatedly to capture timelapse frame from webcam - is the snapshot URL configured correctly and the camera on?" + "Failed repeatedly to capture timelapse frame from webcam - is the snapshot webcam configured correctly and the camera on?" ); var additional = ""; @@ -773,7 +773,7 @@ $(function () { "

" + _.sprintf( gettext( - "Rendering of timelapse %(movie_prefix)s is not possible since no frames were captured. Is the webcam configured correctly?" + "Rendering of timelapse %(movie_prefix)s is not possible since no frames were captured. Is the snapshot webcam configured correctly?" ), {movie_prefix: _.escape(payload.movie_prefix)} ) + diff --git a/src/octoprint/templates/dialogs/settings/webcam.jinja2 b/src/octoprint/templates/dialogs/settings/webcam.jinja2 index b81710708..dfe2f2d75 100644 --- a/src/octoprint/templates/dialogs/settings/webcam.jinja2 +++ b/src/octoprint/templates/dialogs/settings/webcam.jinja2 @@ -2,11 +2,10 @@ {{ _('Note: ') }}{{ _('Please note that OctoPrint merely embeds a webcam stream & access a snapshot URL. It does not actually run its own webcam server or interact directly with your camera. It thus can\'t impose access restrictions on it or enable/disable the stream for you. Please see this FAQ entry for more explanation.', url="http://faq.octoprint.org/external-webcam-server") }} -

{{ _('Webcam') }}

+

{{ _('Webcam Streaming') }}

{% include "snippets/settings/webcam/webcamEnabled.jinja2" %} - {% include "snippets/settings/webcam/defaultWebcam.jinja2" %}

{{ _('Timelapse Recordings') }}

@@ -29,3 +28,22 @@ + +

{{ _('Fallback Webcam') }}

+ +{% trans %}

+ Select the webcam to fall back to to populate the stream and snapshot URLs on the settings + API used by old clients that do not yet utilize the webcam plugin + system introduced in OctoPrint 1.9.0. If the selected webcam does not + provide a snapshot or stream URL, it won't be available on the settings API and thus + to older clients. +

+

+ Note that this does not affect the webcam stream options available + in OctoPrint's core UI, nor the snapshot camera used for timelapse recordings. + It is exclusively relevant for the compatibility layer provided on the settings API. +

{% endtrans %} + +
+ {% include "snippets/settings/webcam/defaultWebcam.jinja2" %} +
diff --git a/src/octoprint/templates/snippets/settings/webcam/defaultWebcam.jinja2 b/src/octoprint/templates/snippets/settings/webcam/defaultWebcam.jinja2 index b1ebc496d..f406d6736 100644 --- a/src/octoprint/templates/snippets/settings/webcam/defaultWebcam.jinja2 +++ b/src/octoprint/templates/snippets/settings/webcam/defaultWebcam.jinja2 @@ -1,5 +1,5 @@ -
- +
+
- {{ _('Snapshot stream')}}  +
+ {{ _('Snapshot stream')}}    @@ -23,11 +23,18 @@ {{ _('Not supported')}} - +
- {{ _('You can make changes to this webcam in the plugin\'s settings.') }} +
{% trans %} +

+ Selects the webcam to use to take snapshots for the timelapse. +

+

+ You can make changes to this webcam's configuration in its plugin settings, if it provides any. +

+ {% endtrans %}
diff --git a/src/octoprint/templates/tabs/control.jinja2 b/src/octoprint/templates/tabs/control.jinja2 index 7ee865855..222a37896 100644 --- a/src/octoprint/templates/tabs/control.jinja2 +++ b/src/octoprint/templates/tabs/control.jinja2 @@ -1,9 +1,6 @@ {% if enableWebcam %}
- {% set nsContent = namespace(mark_active = True) %} - {% set nsTab = namespace(mark_active = True) %} -
{% for key in templates.webcam.order %} {% set entry, data = templates.webcam.entries[key] %} @@ -11,7 +8,7 @@ {% if "custom_bindings" not in data or data["custom_bindings"] %}{% endif %}
{% try "There was an error with the template {filename} at line number {lineno}: {exception}" %}{% include data.template ignore missing %}{% endtry %} @@ -29,7 +26,7 @@ {% set entry, data = templates.webcam.entries[key] %} {% endfor %} diff --git a/src/octoprint/templates/tabs/timelapse.jinja2 b/src/octoprint/templates/tabs/timelapse.jinja2 index 6affc0421..a02ad610f 100644 --- a/src/octoprint/templates/tabs/timelapse.jinja2 +++ b/src/octoprint/templates/tabs/timelapse.jinja2 @@ -92,8 +92,8 @@