diff --git a/files.py b/files.py index dd602ca..e412dbe 100644 --- a/files.py +++ b/files.py @@ -270,12 +270,23 @@ class EntrySchema(ma.SQLAlchemyAutoSchema): def get_full_path(self, obj): return obj.FullPathOnFS() +# quick helper func to return the timestampe of a (jscript) file. +# we use this as a quick/hacky way of versioning the jscript file +def get_version(fname): + mtime = os.path.getmtime(fname) + return int(mtime) # Use timestamp as version + # global - this will be use more than once below, so do it once for efficiency entries_schema = EntrySchema(many=True) FOT_Schema = FaceOverrideTypeSchema(many=True) path_Schema = PathSchema(many=True) person_Schema = PersonSchema(many=True) +js_vers={} +js_vers['fs'] = get_version( url_for( 'internal', filename='js/files_support.js') ) +js_vers['vs'] = get_version( url_for( 'internal', filename='js/view_support.js') ) +js_vers['ft'] = get_version( url_for( 'internal', filename='js/files_transform.js') ) + ################################################################################ # /get_entries_by_ids -> route where we supply list of entry ids (for next/prev # page of data we want to show). Returns json of all matching entries @@ -471,7 +482,7 @@ def file_list_ip(): def files_ip(): OPT=States( request ) query_data = GetQueryData( OPT ) - return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, query_data=query_data ) + return render_template("files.html", page_title=f"View Files ({OPT.path_type} Path)", OPT=OPT, query_data=query_data, js_vers=js_vers ) ################################################################################ # /files -> show thumbnail view of files from storage_path diff --git a/templates/files.html b/templates/files.html index 0f55a97..c684fcc 100644 --- a/templates/files.html +++ b/templates/files.html @@ -15,9 +15,9 @@ } #tst90:hover,#tst90:focus { filter: invert(73%) sepia(27%) saturate(3970%) hue-rotate(146deg) brightness(94%) contrast(100%); } - - - + + +