Skip to content

Commit

Permalink
Search images by file name (#206)
Browse files Browse the repository at this point in the history
* feat(Images.Query): add literal file_name field

* feat(templates/search): add file_name to search dropdown
  • Loading branch information
mdashlw authored Mar 14, 2024
1 parent 3b2f5f3 commit a342894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/philomena/images/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule Philomena.Images.Query do
float_fields: ~W(aspect_ratio wilson_score duration),
date_fields: ~W(created_at updated_at first_seen_at),
literal_fields:
~W(faved_by orig_sha512_hash sha512_hash uploader source_url original_format mime_type),
~W(faved_by orig_sha512_hash sha512_hash uploader source_url original_format mime_type file_name),
bool_fields: ~W(animated processed thumbnails_generated),
ngram_fields: ~W(description),
custom_fields: ~W(gallery_id),
Expand Down
1 change: 1 addition & 0 deletions lib/philomena_web/templates/search/_form.html.slime
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ h1 Search
a data-search-add="comment_count.gt:20" data-search-select-last="2" data-search-show-help="numeric" Number of comments
a data-search-add="uploader:k_a" data-search-select-last="3" data-search-show-help="literal" Uploader
a data-search-add="original_format:gif" data-search-select-last="3" data-search-show-help="literal" File extension
a data-search-add="file_name:tumblr_*" data-search-select-last="8" data-search-show-help="literal" Original file name
a data-search-add="mime_type:image/jpeg" data-search-select-last="10" data-search-show-help="literal" MIME type
a data-search-add="source_url:*deviantart.com*" data-search-select-last="16" data-search-show-help="literal" Image source URL
a data-search-add="width:1920" data-search-select-last="4" data-search-show-help="numeric" Image width
Expand Down

0 comments on commit a342894

Please sign in to comment.