summaryrefslogtreecommitdiff
path: root/flaskapi.py
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-05-10 19:47:31 -0500
committerTim Keller <tjkeller.xyz>2025-05-10 19:47:31 -0500
commite7036d21d5e5c87702724283f55a77d07344f4fe (patch)
tree45d0801042b38ca595c32e7c4a0dd42b96780ede /flaskapi.py
parentfc570fc38b450b90a2c8da05e5619f19ba8e983d (diff)
downloadimmich-frame-e7036d21d5e5c87702724283f55a77d07344f4fe.tar.xz
immich-frame-e7036d21d5e5c87702724283f55a77d07344f4fe.zip
add flaskapi
Diffstat (limited to 'flaskapi.py')
-rw-r--r--flaskapi.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/flaskapi.py b/flaskapi.py
new file mode 100644
index 0000000..4b1a259
--- /dev/null
+++ b/flaskapi.py
@@ -0,0 +1,24 @@
+from flask import Flask, Blueprint, request
+
+app = Flask(__name__)
+
+@app.route("/")
+def home():
+ return "Flask is running!"
+
+api = Blueprint("api", __name__)
+
+@api.route("/seek")
+def seek():
+ pd = app.config["pix_display"]
+
+ increment = request.args.get("increment", default=1, type=int)
+ pd.queue.put(lambda: pd.seek(increment))
+ while not pd.queue.empty():
+ pass
+ return {
+ "imageTime": pd.image_time,
+ "imageIndex": pd.current_texture_index,
+ }
+
+app.register_blueprint(api, url_prefix="/api")