Commit graph

24 commits

Author SHA1 Message Date
37802a2aa1 api/v0: inline listing helpers 2025-05-03 17:18:47 +00:00
9d8b300d11 api/v0: improve error conditions
Return an HTTP 404 when no media is found and an HTTP 400 when some of
the requested tags aren't found.
2025-05-03 17:05:11 +00:00
fa6f642ca2 api/v0: simplify Tags model get
Since previous commit, get only effectively serves search for ids or
displays. Remove the machinery to deal with other stuff and simplify
error checking.
2025-05-03 16:42:30 +00:00
f1c3d1ed0e api/v0: simplify show_tag
Only accept an ID or the display name. Stop accepting kind_id and raw
names. As a consequence of the latter, the endpoint now always returns
exactly one tag.
2025-05-03 16:42:30 +00:00
ecbc3ded8d api/v0: remove lib/Pooru/Schema.pm
Missed in ad46c6ba85.
2025-05-03 13:55:22 +00:00
19369d4dc2 Consistently use v5.40 everywhere
Also make the file headings more consistent with regards to spacingg.
2025-05-03 13:53:37 +00:00
c5eef1be0b api/v0: inline Random controller 2025-05-03 13:50:07 +00:00
ad46c6ba85 api/v0: remove old model's remnants 2025-05-03 13:37:54 +00:00
291775bb04 site: adjust to the new model
similarity_score was renamed to score.
2025-05-03 13:35:00 +00:00
230c595e80 api/v0: switch the API to the new model 2025-05-03 13:34:26 +00:00
0635e37e13 api/v0: add a new model implementation
Use DBI exclusively to have a fine control of the produced queries. dbic
requires a lot of symbols permutation to produce the desired ones.
2025-05-03 13:30:27 +00:00
ce6635f1d9 api/v0: predefined searchs for Random controller 2025-04-29 21:27:17 +00:00
4c476dfd3e site: show similar media in media view 2025-04-29 12:11:30 +00:00
c625ee860a api/v0: implement similarity search for media
Use a very naive approach: define similarity as the number of shared
tags between two media pieces. It can be implemented in SQL and produces
decent results.
2025-04-29 12:08:22 +00:00
29aa172391 api/v0: make escaped sequences work for search
Reorder the regex chars and remove a needless escape while there.
2025-04-28 21:00:32 +00:00
ba424dcb02 site: make /search always return JSON 2025-04-28 12:24:33 +00:00
d1cbeea1ac site: also include search bar in media view 2025-04-27 17:32:19 +00:00
c11460232c Small style fixes
- write site's HTTP 400 in a single line
- add an space at the end of the query parameter in site's random/tag in
  order to start writing after a space on focus
- use <%= ... %> instead of manually escaping a smiley
2025-04-27 17:20:44 +00:00
08be6b17f5 site: implement search functionality 2025-04-27 15:20:49 +00:00
3ae6b02672 api/v0: implement tag search 2025-04-27 15:19:28 +00:00
d1031a9162 api/v0: remove duplicates from tags in list_media 2025-04-27 15:11:03 +00:00
e178a261e6 site: use promise interfaces for Mojo::UserAgent 2025-04-26 17:16:39 +00:00
1a0a224edc site: extend extended_pager
Make it return a hash for page numbers and shortcuts. Move logic
handling for the shortcuts from the templates to the helper. Make the
pager length configurable. Add a helper for producing the shortcuts'
links.
2025-04-26 13:29:29 +00:00
dd492db92e Initial import 2025-04-26 09:41:50 +00:00