mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-09-08 23:43:16 +01:00
Compare commits
4 Commits
82f93ae557
...
d80cf9473a
Author | SHA1 | Date | |
---|---|---|---|
d80cf9473a | |||
62ee224736 | |||
410ed18526 | |||
d29badd0fe |
@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.2.16"
|
current_version = "0.2.19"
|
||||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
serialize = ["{major}.{minor}.{patch}"]
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
replace = "{new_version}"
|
replace = "{new_version}"
|
||||||
|
@ -4,7 +4,7 @@ FROM python:3.11-slim
|
|||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Set version label
|
# Set version label
|
||||||
ARG VERSION="0.2.16"
|
ARG VERSION="0.2.19"
|
||||||
LABEL version=$VERSION
|
LABEL version=$VERSION
|
||||||
|
|
||||||
# Copy project files into the container
|
# Copy project files into the container
|
||||||
|
@ -4,6 +4,7 @@ import os
|
|||||||
|
|
||||||
from routes import (
|
from routes import (
|
||||||
auth_routes,
|
auth_routes,
|
||||||
|
favourites_routes,
|
||||||
gallery_routes,
|
gallery_routes,
|
||||||
image_routes,
|
image_routes,
|
||||||
index_routes,
|
index_routes,
|
||||||
@ -24,6 +25,7 @@ auth_routes.init_app(user_config)
|
|||||||
# Register blueprints
|
# Register blueprints
|
||||||
app.register_blueprint(index_routes.bp)
|
app.register_blueprint(index_routes.bp)
|
||||||
app.register_blueprint(auth_routes.bp)
|
app.register_blueprint(auth_routes.bp)
|
||||||
|
app.register_blueprint(favourites_routes.bp)
|
||||||
app.register_blueprint(gallery_routes.bp)
|
app.register_blueprint(gallery_routes.bp)
|
||||||
app.register_blueprint(image_routes.bp)
|
app.register_blueprint(image_routes.bp)
|
||||||
app.register_blueprint(job_routes.bp)
|
app.register_blueprint(job_routes.bp)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
from . import auth_routes, create_routes, gallery_routes, image_routes, index_routes, job_routes, settings_routes
|
from . import auth_routes, create_routes, favourites_routes, gallery_routes, image_routes, index_routes, job_routes, settings_routes
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"auth_routes",
|
"auth_routes",
|
||||||
"create_routes",
|
"create_routes",
|
||||||
|
"favourites_routes",
|
||||||
"gallery_routes",
|
"gallery_routes",
|
||||||
"image_routes",
|
"image_routes",
|
||||||
"index_routes",
|
"index_routes",
|
||||||
|
23
routes/favourites_routes.py
Normal file
23
routes/favourites_routes.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
from flask import Blueprint, jsonify, send_file
|
||||||
|
import os
|
||||||
|
import json
|
||||||
|
|
||||||
|
bp = Blueprint("favourites_routes", __name__)
|
||||||
|
favourites_file = "./favourites.json"
|
||||||
|
|
||||||
|
def get_favourites():
|
||||||
|
if not os.path.exists(favourites_file):
|
||||||
|
return []
|
||||||
|
with open(favourites_file, 'r') as f:
|
||||||
|
return json.load(f)
|
||||||
|
|
||||||
|
@bp.route("/favourites", methods=["GET"])
|
||||||
|
def favourites():
|
||||||
|
"""
|
||||||
|
Route to return the favourites.json file
|
||||||
|
"""
|
||||||
|
if os.path.exists(favourites_file):
|
||||||
|
return send_file(favourites_file, mimetype='application/json')
|
||||||
|
else:
|
||||||
|
# If the file doesn't exist, return an empty array as JSON
|
||||||
|
return jsonify([])
|
Loading…
x
Reference in New Issue
Block a user