url_search: Option<String>,
show_nsfw: Option<bool>,
show_bot_accounts: Option<bool>,
+ show_read_posts: Option<bool>,
saved_only: Option<bool>,
- unread_only: Option<bool>,
page: Option<i64>,
limit: Option<i64>,
}
url_search: None,
show_nsfw: None,
show_bot_accounts: None,
+ show_read_posts: None,
saved_only: None,
- unread_only: None,
page: None,
limit: None,
}
self
}
+ pub fn show_read_posts<T: MaybeOptional<bool>>(mut self, show_read_posts: T) -> Self {
+ self.show_read_posts = show_read_posts.get_optional();
+ self
+ }
+
pub fn saved_only<T: MaybeOptional<bool>>(mut self, saved_only: T) -> Self {
self.saved_only = saved_only.get_optional();
self
query = query.filter(person::bot_account.eq(false));
};
- if self.saved_only.unwrap_or(false) {
- query = query.filter(post_saved::id.is_not_null());
+ if !self.show_read_posts.unwrap_or(true) {
+ query = query.filter(post_read::id.is_null());
};
- if self.unread_only.unwrap_or(false) {
- query = query.filter(post_read::id.is_not_null());
+ if self.saved_only.unwrap_or(false) {
+ query = query.filter(post_saved::id.is_not_null());
};
query = match self.sort.unwrap_or(SortType::Hot) {