diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2021-01-05 13:51:39 -0500 |
|---|---|---|
| committer | Shyam Sunder <sgsunder1@gmail.com> | 2021-01-05 13:51:39 -0500 |
| commit | 2dfd1c2192961065fc27785c31cd86f7ceb82412 (patch) | |
| tree | 694c9f64435f37c5636f94a9df6eb6425e45be03 | |
| parent | 2bdb072296633e444ec63eee45eea33272dfaefc (diff) | |
server/search: add MD5-based search
| -rw-r--r-- | client/html/help_search_posts.tpl | 10 | ||||
| -rw-r--r-- | server/szurubooru/search/configs/post_search_config.py | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/client/html/help_search_posts.tpl b/client/html/help_search_posts.tpl index efcb7c1..0fe584f 100644 --- a/client/html/help_search_posts.tpl +++ b/client/html/help_search_posts.tpl @@ -83,10 +83,18 @@ <td>having given flag. <code><value></code> can be either <code>loop</code> or <code>sound</code>.</td> </tr> <tr> - <td><code>content-checksum</code></td> + <td><code>sha1</code></td> <td>having given SHA1 checksum</td> </tr> <tr> + <td><code>md5</code></td> + <td>having given MD5 checksum</td> + </tr> + <tr> + <td><code>content-checksum</code></td> + <td>alias of <code>sha1</code></td> + </tr> + <tr> <td><code>file-size</code></td> <td>having given file size (in bytes)</td> </tr> diff --git a/server/szurubooru/search/configs/post_search_config.py b/server/szurubooru/search/configs/post_search_config.py index fc98e55..ddc003b 100644 --- a/server/szurubooru/search/configs/post_search_config.py +++ b/server/szurubooru/search/configs/post_search_config.py @@ -274,10 +274,14 @@ class PostSearchConfig(BaseSearchConfig): ), ), ( - ["content-checksum"], + ["content-checksum", "sha1"], search_util.create_str_filter(model.Post.checksum), ), ( + ["md5"], + search_util.create_str_filter(model.Post.checksum_md5), + ), + ( ["file-size"], search_util.create_num_filter(model.Post.file_size), ), |