From d71d7b03c2bda2937bf44f309849d91845428f52 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 2 Mar 2017 17:38:15 -0800 Subject: [PATCH] Add photo/refresh_metadata endpoint and button --- etiquette_site.py | 8 ++++++++ templates/photo.html | 23 ++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/etiquette_site.py b/etiquette_site.py index b6d0ddb..bafb436 100644 --- a/etiquette_site.py +++ b/etiquette_site.py @@ -675,6 +675,14 @@ def post_photo_remove_tag(photoid): ''' return post_photo_add_remove_tag_core(photoid, request.form['tagname'], 'remove') +@site.route('/photo//refresh_metadata', methods=['POST']) +def post_photo_refresh_metadata(photoid): + ''' + Refresh the file metadata. + ''' + photo = P_photo(photoid, response_type='json') + photo.reload_metadata() + return jsonify.make_json_response({}) def post_tag_create_delete_core(tagname, function): try: diff --git a/templates/photo.html b/templates/photo.html index 2b9a6e3..90bef36 100644 --- a/templates/photo.html +++ b/templates/photo.html @@ -107,6 +107,10 @@ max-height: 100%; width: 100%; } +#refresh_metadata_button +{ + font-size: 11px; +} @@ -133,7 +137,10 @@ -

File info

+

+ File info + +