- templateContext["albums"] = albums
- templateContext["albumPagination"] = Pagination(albums, 12).apply { page = request.parameters["page"]?.toIntOrNull() ?: 0 }
+ albums.paginate(webInterface.core.preferences.imagesPerPage)
+ .turnTo(freenetRequest.parameters["page"]?.toIntOrNull() ?: 0)
+ .also { pagination ->
+ templateContext["albumPagination"] = pagination
+ templateContext["albums"] = pagination.items
+ }