diff --git a/app/main.py b/app/main.py index 4437231..f08ef10 100644 --- a/app/main.py +++ b/app/main.py @@ -17,20 +17,21 @@ main = Blueprint('main', __name__) @main.route('/') def index(): - from random import choice # (kept from your original) - image = ImageRecord.query.order_by(func.random()).first() - background_url = None + return redirect(url_for("gallery")) + # from random import choice # (kept from your original) + # image = ImageRecord.query.order_by(func.random()).first() + # background_url = None - if image: - path = image.thumb_path or image.filepath - filename = path.replace('/images/', '') - background_url = url_for('main.serve_image', filename=filename) + # if image: + # path = image.thumb_path or image.filepath + # filename = path.replace('/images/', '') + # background_url = url_for('main.serve_image', filename=filename) - return render_template('index.html', background_url=background_url) + # return render_template('index.html', background_url=background_url) @main.route('/gallery') -@login_required +# @login_required def gallery(): """ Gallery with pagination and optional tag filter (?tag=artist:NAME or any tag name). @@ -71,7 +72,7 @@ def serve_image(filename): @main.route('/tags') -@login_required +# @login_required def tag_list(): """ Generic tag explorer: @@ -110,20 +111,20 @@ def tag_list(): active_kind=kind) @main.route('/artists') -@login_required +# @login_required def artist_list(): # Backward-compatible route that now shows the Tag Explorer filtered to artist tags return redirect(url_for('main.tag_list', kind='artist')) @main.route('/artist/') -@login_required +# @login_required def artist_gallery(artist_name): # Backward-compatible: go to gallery filtered by artist tag return redirect(url_for('main.gallery', tag=f"artist:{artist_name}")) @main.route('/settings') -@login_required +# @login_required def settings(): if not current_user.is_admin: abort(403) @@ -131,7 +132,7 @@ def settings(): @main.route('/trigger-thumbnail-generation', methods=['POST']) -@login_required +# @login_required def trigger_thumbnail_generation(): if not current_user.is_admin: flash("You do not have permission to perform this action.", "danger") @@ -148,7 +149,7 @@ def trigger_thumbnail_generation(): @main.route('/import-images') -@login_required +# @login_required def trigger_image_import(): with open('/import/trigger.flag', 'w') as f: f.write('start') @@ -157,7 +158,7 @@ def trigger_image_import(): @main.route('/reset-db', methods=['POST']) -@login_required +# @login_required def reset_db(): """ Safe reset that works with Postgres (TRUNCATE ... CASCADE). @@ -194,7 +195,7 @@ def reset_db(): # ---------------------------- @main.get("/image//tags") -@login_required +# @login_required def list_tags(image_id): from app.models import ImageRecord img = ImageRecord.query.get_or_404(image_id) @@ -202,7 +203,7 @@ def list_tags(image_id): @main.post("/image//tags/add") -@login_required +# @login_required def add_tag(image_id): """ Minimal JSON endpoint to add a tag to an image. @@ -233,7 +234,7 @@ def add_tag(image_id): @main.post("/image//tags/remove") -@login_required +# @login_required def remove_tag(image_id): """ Minimal JSON endpoint to remove a tag from an image. diff --git a/app/templates/layout.html b/app/templates/layout.html index ce269c5..77424bb 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -11,7 +11,11 @@