Commit Graph

59 Commits

Author SHA1 Message Date
c9e6ffd33c clippy fix 2025-03-07 17:08:58 -05:00
d097495a41 fix: handle case insensitivity for subs 2025-02-27 20:10:01 -05:00
f3ca7bb7d1 feat: allow for case-insensitive search redirects (fix #389) 2025-02-27 14:35:09 -05:00
d17d097b12 Fix parts of CI (#304)
* Run cargo fmt, hide clippy::cmp_owned errors

* Bump deps

* Fix failing test

* Update src/client.rs

---------

Co-authored-by: Matthew Esposito <matt@matthew.science>
2024-10-31 22:50:50 -04:00
49ef59e000 chore: make library 2024-10-21 20:46:03 -04:00
1838fdaea4 Replace askama with rinja (#276) 2024-10-02 17:43:13 -04:00
8d0ed4682e feat(search): redirect u/ and user/ to profile (#268) 2024-09-27 08:29:33 -04:00
72f7d9d08c fix(search): handle multi-sub search (#263) 2024-09-24 23:20:12 -04:00
9f9ae45f6e Add many Clippy's, fix many Clippy's 2024-01-19 20:16:17 -05:00
eb07a2ce7c Make gated subreddits accessible by treating them as quarantined (#722)
* Fix gated communities being unviewable by treating them as quarantined

* Show restriction reason in quarantine template

* Add `gated` checks for other requests
2023-02-26 00:40:32 -07:00
9a7b3b29f5 Merge remote-tracking branch 'origin/master' into hide_awards 2023-01-03 11:12:27 -07:00
c83a4e0cc8 Landing page for NSFW content, SFW-only mode (#656)
Co-authored-by: Matt <matt@matthew.science>
Co-authored-by: Spike <19519553+spikecodes@users.noreply.github.com>
2023-01-03 02:39:45 -07:00
6a785baa2c Add hide_awards config 2023-01-01 21:39:38 -05:00
9e434e7db6 Search - add support for raw reddit links (#663)
* Search - add support for raw reddit links

If a search query starts with 'https://www.reddit.com/' or 'https://old.reddit.com/',
this prefix will be truncated and the query will be processed normally.
For example, a search query 'https://www.reddit.com/r/rust' will redirect to
r/rust.

* Search - support a wider variety of reddit links.

Add once cell dependency for static regex support (avoid compiling the
same regex multiple times).
All search queries are now matched against a regex (provided by @Daniel-Valentine)
that determines if it is a reddit link. If it is, the prefix specifying
the reddit instance will be truncated from the query that will then be
processed normally.
For example, the query 'https://www.reddit.com/r/rust' will be treated
the same way as the query 'r/rust'.
2022-12-31 20:57:42 -07:00
ab30b8bbec Bugfix: 'all posts are hidden because NSFW' when no posts where found (#666)
* Fix 'all_posts_hidden_nsfw' when there are no posts.

If a search query yielded no results and the user set nsfw posts to be
hidden, libreddit would show 'All posts are hidden because they are NSFW.
Enable "Show NSFW posts" in settings to view'. This is fixed by
verifying tnat posts.len > 0 before setting 'all_posts_hidden_nsfw' to
true.

* Add a message when no posts were found.

* Delete 2
2022-12-31 19:11:59 -07:00
e579b97442 List post duplicates (resolves #574). 2022-12-03 01:08:36 -07:00
465d9b7ba7 Implement 'posts hidden because of NSFW'. (Resolves #159) (#619) 2022-11-07 20:54:49 -07:00
322aa97a18 Fix HTML encoding in templating (#404) 2022-05-21 05:28:31 +00:00
9c325c2cbf Search fixes (#384)
* Default to searching within subreddit

* Redirect to subreddit from search
2022-01-05 14:06:41 -08:00
7aeabfc4bc Rewrite Reddit post links to Libreddit equivalents 2021-12-26 21:18:20 -08:00
0656756d21 Fix #196 2021-11-29 22:29:41 -08:00
888e7b302d Filter subreddits and users (#317)
* Initial work on filtering subreddits and users

* Fix doubly-prefixed subreddit name in search alt text (e.g. r/r/pics)

* Don't set post title to "Comment" if empty - this could throw off actual posts with the title "Comment"

* Filter search results

* Fix filtering to differentiate between "this subject itself is filtered" vs "all posts on this current page have been filtered"

* Remove unnecessary check

* Clean up

* Cargo format

* Collapse comments from filtered users

Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
2021-11-26 04:02:04 +00:00
8e332b0630 Show full subreddit results in search 2021-11-23 22:24:23 -08:00
6a4191f3b5 Fix #272 2021-09-09 17:28:55 -07:00
4defb58f2a Optimizations and commenting 2021-05-20 12:24:06 -07:00
43ed9756dc Upgrade to v0.14 2021-05-16 09:11:38 -07:00
8bb247af3b Added support for quarantined subreddits (#219)
* Added support for quarantined subreddits

* Added confirmation wall for quarantined subreddits

* Added quarantine walls to other routes and fixed case issue

* Correct obsolete use of cookie()

* Refactor param() and quarantine()

Co-authored-by: Spike <19519553+spikecodes@users.noreply.github.com>
2021-05-16 15:53:39 +00:00
e4f9bd7b8d Configure default settings using environment variables 2021-05-15 13:59:42 -07:00
928907086c HLS video playback (#182)
* HLS video playback

Signed-off-by: Adrian Lebioda <adrianlebioda@gmail.com>

* Add LibreJS compliance

* Locally host hls.js

* Notification about HLS under videos that support it

Signed-off-by: Adrian Lebioda <adrianlebioda@gmail.com>

* Use .contains() instead of .find() == None

* Make list of preferences constant

* Change headers_keys from Vector into Array

* Fix incorrect detecting of # in paths

* Remove trailing-slash-appending if statement

* Change HLS notification styling

Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
2021-05-10 01:25:52 +00:00
536a766960 WIP: Various subreddit & post fixes (#215)
* Fixed random subreddit issue

* Fixed large subreddit icon rendering

* Formatting fix

* Fix dodgy HTML rendering issues

* Revert "Fix dodgy HTML rendering issues"

This reverts commit 58be5f449b72f271d2b3c046870b652d1e715289.
2021-05-09 15:40:49 +00:00
966e0ce921 Expand truncated numbers on mouseover. Close #156 2021-03-20 15:42:47 -07:00
9b5176f7b9 Sub icons and truncated subscribers in search results 2021-03-18 21:32:54 -07:00
b14b4ff551 Rewrite server and client using Hyper 2021-03-17 15:30:33 -07:00
1c36549134 Fix #146 2021-03-09 07:22:17 -08:00
bf783c2f3a Optimize type casting 2021-03-08 18:49:06 -08:00
a3ec44149c Categorize utilities 2021-02-24 21:29:23 -08:00
dd67b52199 Fix #126 2021-02-20 18:36:30 -08:00
9cfab348eb Filter by flair. Closes #124 2021-02-20 13:59:16 -08:00
ebbdd7185f Move from Actix Web to Tide (#99)
* Initial commit

* Port posts

* Pinpoint Tide Bug

* Revert testing

* Add basic sub support

* Unwrap nested routes

* Front page & sync templates

* Port remaining functions

* Log request errors

* Clean main and settings

* Handle /w/ requests

* Create template() util

* Reduce caching time to 30s

* Fix subscription redirects

* Handle frontpage sorting
2021-02-09 17:38:52 +00:00
1653d4fb4c Hide NSFW content by default 2021-01-30 21:43:46 -08:00
b2ad2f636c Resolve merge conflicts 2021-01-23 10:55:11 +01:00
077c222a4e Experiment with caching 2021-01-23 10:48:33 +01:00
2270b6cf95 Reduce post padding 2021-01-21 21:25:51 -08:00
6641e242af Allow NSFW searching 2021-01-20 18:26:58 -08:00
18684c934b Refactor subreddit searching 2021-01-14 11:45:04 -08:00
735f79d80b Merge pull request #2 from spikecodes/master
Merge upstream into code
2021-01-14 19:29:06 +01:00
a85a4278f6 Add subreddits to search results 2021-01-14 19:22:50 +01:00
0bf5576427 Categorize routes and refactor error handlers 2021-01-13 19:53:52 -08:00
b13874d0db Add "hide nsfw" option 2021-01-08 17:35:04 -08:00
7e96bb3d80 Optimize use of Result<> 2021-01-06 21:27:24 -08:00