Fix search by SHA256, didn't finish implementing.

master
voussoir 2022-10-29 14:15:16 -07:00
parent 9e204a04c8
commit 328e84b0c7
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
3 changed files with 5 additions and 0 deletions

View File

@ -581,6 +581,7 @@ class PDBPhotoMixin:
is_searchhidden = searchhelpers.normalize_is_searchhidden(is_searchhidden) is_searchhidden = searchhelpers.normalize_is_searchhidden(is_searchhidden)
sha256 = searchhelpers.normalize_sha256(sha256) sha256 = searchhelpers.normalize_sha256(sha256)
mimetype = searchhelpers.normalize_extension(mimetype) mimetype = searchhelpers.normalize_extension(mimetype)
sha256 = searchhelpers.normalize_extension(sha256)
within_directory = searchhelpers.normalize_within_directory(within_directory, warning_bag=warning_bag) within_directory = searchhelpers.normalize_within_directory(within_directory, warning_bag=warning_bag)
yield_albums = searchhelpers.normalize_yield_albums(yield_albums) yield_albums = searchhelpers.normalize_yield_albums(yield_albums)
yield_photos = searchhelpers.normalize_yield_photos(yield_photos) yield_photos = searchhelpers.normalize_yield_photos(yield_photos)
@ -671,6 +672,7 @@ class PDBPhotoMixin:
'has_tags': has_tags, 'has_tags': has_tags,
'has_thumbnail': has_thumbnail, 'has_thumbnail': has_thumbnail,
'mimetype': list(mimetype) or None, 'mimetype': list(mimetype) or None,
'sha256': list(sha256) or None,
'tag_musts': tag_musts or None, 'tag_musts': tag_musts or None,
'tag_mays': tag_mays or None, 'tag_mays': tag_mays or None,
'tag_forbids': tag_forbids or None, 'tag_forbids': tag_forbids or None,

View File

@ -377,6 +377,7 @@ def get_search_core():
extension = request.args.get('extension') extension = request.args.get('extension')
extension_not = request.args.get('extension_not') extension_not = request.args.get('extension_not')
mimetype = request.args.get('mimetype') mimetype = request.args.get('mimetype')
sha256 = request.args.get('sha256')
is_searchhidden = request.args.get('is_searchhidden', False) is_searchhidden = request.args.get('is_searchhidden', False)
yield_albums = request.args.get('yield_albums', True) yield_albums = request.args.get('yield_albums', True)
yield_photos = request.args.get('yield_photos', True) yield_photos = request.args.get('yield_photos', True)
@ -427,6 +428,7 @@ def get_search_core():
'has_thumbnail': has_thumbnail, 'has_thumbnail': has_thumbnail,
'is_searchhidden': is_searchhidden, 'is_searchhidden': is_searchhidden,
'mimetype': mimetype, 'mimetype': mimetype,
'sha256': sha256,
'tag_musts': tag_musts, 'tag_musts': tag_musts,
'tag_mays': tag_mays, 'tag_mays': tag_mays,
'tag_forbids': tag_forbids, 'tag_forbids': tag_forbids,

View File

@ -202,6 +202,7 @@
<li>Overall bitrate: <a href="/search?bitrate={{photo.bitrate|round(method='floor')|int}}..{{photo.bitrate|round(method='ceil')|int}}">{{photo.bitrate|int}}</a> kbps</li> <li>Overall bitrate: <a href="/search?bitrate={{photo.bitrate|round(method='floor')|int}}..{{photo.bitrate|round(method='ceil')|int}}">{{photo.bitrate|int}}</a> kbps</li>
{% endif %} {% endif %}
<li>Created <a href="/search?created={{photo.created.timestamp()|int-43200}}..{{photo.created.timestamp()|int+43200}}">{{photo.created|timestamp_to_naturaldate}}</a></li> <li>Created <a href="/search?created={{photo.created.timestamp()|int-43200}}..{{photo.created.timestamp()|int+43200}}">{{photo.created|timestamp_to_naturaldate}}</a></li>
<li>SHA256: <a href="/search?sha256={{photo.sha256}}"><code>{{photo.sha256[:16]}}</code></a></li>
<li><button id="refresh_metadata_button" class="green_button button_with_spinner" onclick="return refresh_metadata_form();">Refresh metadata</button></li> <li><button id="refresh_metadata_button" class="green_button button_with_spinner" onclick="return refresh_metadata_form();">Refresh metadata</button></li>
{% if request.is_localhost %} {% if request.is_localhost %}
<li><button id="show_in_folder_button" onclick="return show_in_folder_form();">Show in folder</button></li> <li><button id="show_in_folder_button" onclick="return show_in_folder_form();">Show in folder</button></li>