added admin routes/code to allow a scan now and a forced scan
This commit is contained in:
22
files.py
22
files.py
@@ -186,7 +186,29 @@ def file_list():
|
||||
def files():
|
||||
return render_template("files.html", page_title='View Files', file_data=filedata, alert=st.GetAlert(), message=st.GetMessage() )
|
||||
|
||||
################################################################################
|
||||
# /files/scannow -> allows us to force a check for new files
|
||||
################################################################################
|
||||
@app.route("/files/scannow", methods=["GET"])
|
||||
def scannow():
|
||||
filedata.GenerateFileData()
|
||||
return render_template("base.html", page_title='Forced look for new items', file_data=filedata, alert="success", message="Scanned for new files" )
|
||||
|
||||
################################################################################
|
||||
# /files/forcescan -> deletes old data in DB, and does a brand new scan
|
||||
################################################################################
|
||||
@app.route("/files/forcescan", methods=["GET"])
|
||||
def forcescan():
|
||||
Files.query.delete()
|
||||
Settings.query.all()[0].last_import_date=0
|
||||
db.session.commit()
|
||||
filedata.GenerateFileData()
|
||||
return render_template("base.html", page_title='Forced look for new items', file_data=filedata, alert="success", message="Forced remove and recreation of all file data" )
|
||||
|
||||
################################################################################
|
||||
# /static -> returns the contents of any file referenced inside /static.
|
||||
# we create/use symlinks in static/ to reference the images to show
|
||||
################################################################################
|
||||
@app.route("/static/<filename>")
|
||||
def custom_static(filename):
|
||||
return send_from_directory("static/", filename)
|
||||
|
||||
Reference in New Issue
Block a user