🔀 Merge branch 'release/v82'
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / ImageBrowserPage.kt
index 20219d7..a0ca0d7 100644 (file)
@@ -29,9 +29,7 @@ class ImageBrowserPage @Inject constructor(webInterface: WebInterface, loaders:
                } else if (soneRequest.parameters["mode"] == "gallery") {
                        templateContext["galleryRequested"] = true
                        soneRequest.core.sones
-                                       .map(Sone::getRootAlbum)
-                                       .flatMap(Album::getAlbums)
-                                       .flatMap { Album.FLATTENER.apply(it)!! }
+                                       .flatMap(Sone::allAlbums)
                                        .filterNot(Album::isEmpty)
                                        .sortedBy(Album::getTitle)
                                        .also { albums ->