import java.util.logging.Level;
import java.util.logging.Logger;
+import net.pterodactylus.sone.data.Album;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.PostReply;
import net.pterodactylus.sone.data.Profile;
public class SearchPage extends SoneTemplatePage {
/** The logger. */
- private static final Logger logger = getLogger("Sone.Web.Search");
+ private static final Logger logger = getLogger(SearchPage.class.getName());
/** Short-term cache. */
private final LoadingCache<List<Phrase>, Set<Hit<Post>>> hitCache = CacheBuilder.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build(new CacheLoader<List<Phrase>, Set<Hit<Post>>>() {
*/
@Override
@SuppressWarnings("synthetic-access")
- protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
- super.processTemplate(request, templateContext);
+ protected void processSonePage(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
String query = request.getHttpRequest().getParam("query").trim();
if (query.length() == 0) {
throw new RedirectException("index.html");
*/
private String getAlbumId(String phrase) {
String albumId = phrase.startsWith("album://") ? phrase.substring(8) : phrase;
- return (webInterface.getCore().getAlbum(albumId) != null) ? albumId : null;
+ return webInterface.getCore().getAlbum(albumId).isPresent() ? albumId : null;
}
/**