From: David ‘Bombe’ Roden Date: Mon, 21 Nov 2011 17:53:05 +0000 (+0100) Subject: Sort albums by title in gallery mode. X-Git-Tag: 0.7.4^2~2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1b2d5c5525f7f827a3d42a9add3f1bd2c77d6d23;p=Sone.git Sort albums by title in gallery mode. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java b/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java index 406a762..5bb75d1 100644 --- a/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ImageBrowserPage.java @@ -18,8 +18,9 @@ package net.pterodactylus.sone.web; import java.net.URI; -import java.util.HashSet; -import java.util.Set; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Image; @@ -81,10 +82,11 @@ public class ImageBrowserPage extends SoneTemplatePage { String mode = request.getHttpRequest().getParam("mode", null); if ("gallery".equals(mode)) { templateContext.set("galleryRequested", true); - Set albums = new HashSet(); + List albums = new ArrayList(); for (Sone sone : webInterface.getCore().getSones()) { albums.addAll(sone.getAllAlbums()); } + Collections.sort(albums, Album.TITLE_COMPARATOR); templateContext.set("albums", albums); return; }