diff --git a/TODO b/TODO index c5106ee..2c61e84 100644 --- a/TODO +++ b/TODO @@ -1,14 +1,21 @@ ## GENERAL - * when there is an actual error sent from B/E to F/E, you can't clear it other than deleting via sql - - * add an option on the person menu to run_ai_on all photos (or at least import/storage) - * maybe strip unnecessary / at end of directory name. i think i have left behind empty folders, e.g. check switzerland and austria - also should allow move to existing folder soon... * move all unsorted photos/* -> import/ + fix: BUG-64 first + + * metadata at folder level with file level to add more richness + + * add an option on the person menu to run_ai_on all photos (or at least import/storage) * when hitting back button to a search, it doesnt handle the post, etc. + $(document).ready(function() { + window.history.pushState(null, "", window.location.href); + window.onpopstate = function() { + window.history.pushState(null, "", window.location.href); + }; + }); * get build process to create a random string for secret for PROD, otherwise use builtin for dev @@ -26,8 +33,6 @@ * fix up logging in general - * metadata at folder level with file level to add more richness - * support animated gifs in html5 canvas * if a video is really mostly black, then we dont get a thumbnail... (see: 20210526_205257_01.mp4) diff --git a/files.py b/files.py index aa1c1b4..f5c0909 100644 --- a/files.py +++ b/files.py @@ -1,6 +1,6 @@ from wtforms import SubmitField, StringField, HiddenField, validators, Form from flask_wtf import FlaskForm -from flask import request, render_template, redirect, send_from_directory +from flask import request, render_template, redirect, send_from_directory, url_for from main import db, app, ma from sqlalchemy import Sequence from sqlalchemy.exc import SQLAlchemyError @@ -138,7 +138,7 @@ class FileType(db.Model): name = db.Column(db.String, unique=True, nullable=False ) def __repr__(self): - return "".format(self.id, self.name ) + return f"" ################################################################################ # Class describing PA_JobManager_Message and in the DB (via sqlalchemy) @@ -152,8 +152,9 @@ class PA_JobManager_Message(db.Model): job_id = db.Column(db.Integer, db.ForeignKey('job.id') ) alert = db.Column(db.String) message = db.Column(db.String) + job = db.relationship ("Job" ) def __repr__(self): - return " with a dismissable error (ie. anything not success, that is +# not showing duplicates (so rare errors) - allow them to be dismissed +################################################################################ +@app.route("/clear_jm_msg/", methods=["POST"]) +@login_required +def clear_jm_msg(id): + ClearJM_Message(id) + return redirect( url_for("main_page") ) + ################################################################################ # /file_list -> show detailed file list of files from import_path(s) ################################################################################ diff --git a/templates/base.html b/templates/base.html index cf39a4e..de30a6a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -126,10 +126,17 @@ {% set msg=GetJM_Message() %} {% if request.endpoint != "fix_dups" and request.endpoint != "rm_dups" %}
+ {% if msg.job.name != "checkdups" %} +
+ + {% endif %} {% if msg.job_id %} Job #{{msg.job_id}}: {% endif %} {{msg.message|safe}} +
{# if a JM is a danger message, allow code to remove the status, it should be 'permanent' until addressed -- e.g. you have duplicates, fix them #} {% if msg.alert != "danger" %}