indicate dev build

This commit is contained in:
Kamil
2024-11-24 22:10:03 +00:00
parent 7de92f01ec
commit a84ae01e55
3 changed files with 22 additions and 4 deletions

View File

@@ -139,13 +139,19 @@ app.config.update(
result_backend=app.config['REDIS_URL']
)
def read_dev_build_file(file_path="/jellyplist/DEV_BUILD"):
if os.path.exists(file_path):
with open(file_path, "r") as file:
content = file.read().strip()
return f"-{content}"
else:
return None
app.logger.info(f"initializing celery")
celery = make_celery(app)
socketio = SocketIO(app, message_queue=app.config['REDIS_URL'], async_mode='eventlet')
celery.set_default()
app.logger.info(f'Jellyplist {__version__} started')
app.logger.info(f'Jellyplist {__version__}{read_dev_build_file()} started')
from app import routes
from app import jellyfin_routes, tasks
if "worker" in sys.argv:

View File

@@ -1,5 +1,5 @@
from flask import Flask, Response, jsonify, render_template, request, redirect, url_for, session, flash
from app import app, db, functions, sp, jellyfin, celery, jellyfin_admin_token, jellyfin_admin_id,device_id, cache
from app import app, db, functions, sp, jellyfin, celery, jellyfin_admin_token, jellyfin_admin_id,device_id, cache, read_dev_build_file
from app.models import JellyfinUser,Playlist,Track
from celery.result import AsyncResult
from .version import __version__
@@ -7,7 +7,7 @@ from .version import __version__
@app.context_processor
def add_context():
unlinked_track_count = len(Track.query.filter_by(downloaded=True,jellyfin_id=None).all())
version = f"v{__version__}"
version = f"v{__version__}{read_dev_build_file()}"
return dict(unlinked_track_count = unlinked_track_count, version = version)
@app.after_request