From 2dfd1c2192961065fc27785c31cd86f7ceb82412 Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Tue, 5 Jan 2021 13:51:39 -0500 Subject: [PATCH] server/search: add MD5-based search --- client/html/help_search_posts.tpl | 10 +++++++++- 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,9 +83,17 @@ having given flag. <value> can be either loop or sound. - content-checksum + sha1 having given SHA1 checksum + + md5 + having given MD5 checksum + + + content-checksum + alias of sha1 + file-size having given file size (in bytes) 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,9 +274,13 @@ 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),