rr- / szurubooru

Image board engine, Danbooru-style.
GNU General Public License v3.0
704 stars 178 forks source link

Feature request: reverse search functionality in frontend #457

Open TiredSysOp opened 2 years ago

TiredSysOp commented 2 years ago

Add reverse search functionality in frontend

I've found my self uploading content to find matches then deleting what I just uploaded after finding what I was looking for. I wish this was a little bit more user friendly for users that aren't initiated with szurubooru, I don't think this is outside the scope of the project and makes more sense to me now since we now have functionality in the upload tab for using URLs and pasting from clipboard.

I wouldn't know what the best way to implement it is. A tickbox or separate button next to the search button possibly? Would also be appropriate for tokens and tags to be functional at the same time even if only for niche scenarios.

Thanks for keeping this project alive, it keeps me smiling

ztgasdf commented 2 years ago

I am curious, how does one even use the /posts/reverse-search endpoint? I tried using curl -XPOST -H "Accept: application/json" -H "Authorization: Token base64encodedblahhh" --upload-file /var/local/szurubooru/data/posts/1300_1a9d81476dc14cdd.jpg http://szuru-ip/api/posts/reverse-search but it responded with

{
  "name": "ValidationError",
  "title": "Bad Request",
  "description": "Could not decode the request body. The JSON was incorrect or was not encoded as UTF-8."
}

EDIT: Nevermind, I skipped a vital part of the documentation. The working command is curl -XPOST -H "Accept: application/json" -H "Authorization: Token base64encodedblahhh" -F "content=@/var/local/szurubooru/data/posts/1300_1a9d81476dc14cdd.jpg" http://szuru-ip/api/posts/reverse-search