*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.collection.Pagination;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.collection.Pagination;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
Album album = webInterface.getCore().getAlbum(albumId, false);
templateContext.set("albumRequested", true);
templateContext.set("album", album);
Album album = webInterface.getCore().getAlbum(albumId, false);
templateContext.set("albumRequested", true);
templateContext.set("album", album);
albums.addAll(sone.getAllAlbums());
}
Collections.sort(albums, Album.TITLE_COMPARATOR);
albums.addAll(sone.getAllAlbums());
}
Collections.sort(albums, Album.TITLE_COMPARATOR);
- Pagination<Album> albumPagination = new Pagination<Album>(albums, 12).setPage(Numbers.safeParseInteger(request.getHttpRequest().getParam("page"), 0));
+ Pagination<Album> albumPagination = new Pagination<Album>(albums, 12).setPage(Optional.fromNullable(Ints.tryParse(request.getHttpRequest().getParam("page"))).or(0));
templateContext.set("albumPagination", albumPagination);
templateContext.set("albums", albumPagination.getItems());
return;
templateContext.set("albumPagination", albumPagination);
templateContext.set("albums", albumPagination.getItems());
return;