X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FImageBrowserPage.kt;h=5e8701bbb6fb5803ecd15c58dff5948db662fd21;hp=2f165fcfbefb81ce13fff4c9fd7e908ccf80a8d3;hb=6f92f856b4b0afddc207d44a101eff41a403c933;hpb=858eb848396910330160dcce9817c0d3e6d37cce diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt index 2f165fc..5e8701b 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPage.kt @@ -33,8 +33,10 @@ class ImageBrowserPage(template: Template, webInterface: WebInterface): .filterNot(Album::isEmpty) .sortedBy(Album::getTitle) .also { albums -> - templateContext["albums"] = albums - templateContext["albumPagination"] = Pagination(albums, 12).apply { page = request.parameters["page"]?.toIntOrNull() ?: 0 } + Pagination(albums, webInterface.core.preferences.imagesPerPage).apply { page = request.parameters["page"]?.toIntOrNull() ?: 0 }.also { pagination -> + templateContext["albumPagination"] = pagination + templateContext["albums"] = pagination.items + } } } else { templateContext["soneRequested"] = true