mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(octoprint): timelapse uris
This commit is contained in:
parent
254be3c254
commit
093c4b58df
3 changed files with 38 additions and 1 deletions
33
packages/octoprint/octorant-timelapse-uri.patch
Normal file
33
packages/octoprint/octorant-timelapse-uri.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
diff --git a/octoprint_octorant/__init__.py b/octoprint_octorant/__init__.py
|
||||
--- a/octoprint_octorant/__init__.py
|
||||
+++ b/octoprint_octorant/__init__.py
|
||||
@@ -4,6 +4,7 @@ from __future__ import absolute_import
|
||||
import octoprint.plugin
|
||||
import octoprint.settings
|
||||
import octoprint.util
|
||||
+import urllib.parse
|
||||
import subprocess
|
||||
import datetime
|
||||
import time
|
||||
@@ -453,6 +454,8 @@ class OctorantPlugin(
|
||||
# Alter a bit the payload to offer more variables
|
||||
if "time" in data:
|
||||
data["time_formatted"] = str(datetime.timedelta(seconds=int(data["time"])))
|
||||
+ if "movie_basename" in data:
|
||||
+ data["movie_basename_uri"] = urllib.parse.quote(data["movie_basename"])
|
||||
|
||||
self._logger.debug(
|
||||
"Available variables for event " + eventID + ": " + ", ".join(list(data))
|
||||
diff --git a/octoprint_octorant/events.py b/octoprint_octorant/events.py
|
||||
index 0c53f88..9e7b19c 100644
|
||||
--- a/octoprint_octorant/events.py
|
||||
+++ b/octoprint_octorant/events.py
|
||||
@@ -135,7 +135,7 @@ EVENTS = {
|
||||
"enabled": False,
|
||||
"media": "timelapse",
|
||||
"message": "🎥 Timelapse has been created: {movie_basename}",
|
||||
- "variables": ["gcode", "movie", "movie_basename", "movie_prefix"],
|
||||
+ "variables": ["gcode", "movie", "movie_basename", "movie_basename_uri", "movie_prefix"],
|
||||
},
|
||||
"timelapse_failed": {
|
||||
"enabled": False,
|
||||
|
|
@ -14,6 +14,10 @@ in buildPlugin {
|
|||
sha256 = "sha256-gP79zlJ8gdtpddXOJIMhouSbwXnrSf+c1bURkN/7jvw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./octorant-timelapse-uri.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
pillow
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue