Allow user to configuration the number of posts shown on a page.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / SearchPage.java
index cf79b4d..1d1aa36 100644 (file)
@@ -103,24 +103,13 @@ public class SearchPage extends SoneTemplatePage {
                List<Post> resultPosts = Converters.convertList(sortedPostHits, new HitConverter<Post>());
 
                /* pagination. */
-               Pagination<Sone> sonePagination = new Pagination<Sone>(resultSones, 10).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("sonePage"), 0));
-               Pagination<Post> postPagination = new Pagination<Post>(resultPosts, 10).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("postPage"), 0));
+               Pagination<Sone> sonePagination = new Pagination<Sone>(resultSones, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("sonePage"), 0));
+               Pagination<Post> postPagination = new Pagination<Post>(resultPosts, webInterface.getCore().getPreferences().getPostsPerPage()).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("postPage"), 0));
 
                templateContext.set("sonePagination", sonePagination);
                templateContext.set("soneHits", sonePagination.getItems());
                templateContext.set("postPagination", postPagination);
                templateContext.set("postHits", postPagination.getItems());
-
-               /* mark found posts and Sones as knew. */
-               for (Sone sone : sonePagination.getItems()) {
-                       webInterface.getCore().markSoneKnown(sone);
-               }
-               for (Post post : postPagination.getItems()) {
-                       webInterface.getCore().markPostKnown(post);
-                       for (Reply reply : webInterface.getCore().getReplies(post)) {
-                               webInterface.getCore().markReplyKnown(reply);
-                       }
-               }
        }
 
        //