X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FKnownSonesPage.java;h=0e27265a76899c2a7fa4e6428c4e7236876fcd58;hb=ac3b11129679548836a3603f0db756986c83e675;hp=52e4239e3ae0257a4effa4b60ba9fef1ad7fa0bc;hpb=45f92ec63dbf8134d92ceed67294faa38117b195;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java index 52e4239..0e27265 100644 --- a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java +++ b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java @@ -97,6 +97,12 @@ public class KnownSonesPage extends SoneTemplatePage { } else { Collections.sort(knownSones, Sone.POST_COUNT_COMPARATOR); } + } else if ("images".equals(sortField)) { + if ("asc".equals(sortOrder)) { + Collections.sort(knownSones, new ReverseComparator(Sone.IMAGE_COUNT_COMPARATOR)); + } else { + Collections.sort(knownSones, Sone.IMAGE_COUNT_COMPARATOR); + } } else { if ("desc".equals(sortOrder)) { Collections.sort(knownSones, new ReverseComparator(Sone.NICE_NAME_COMPARATOR)); @@ -108,4 +114,5 @@ public class KnownSonesPage extends SoneTemplatePage { templateContext.set("pagination", sonePagination); templateContext.set("knownSones", sonePagination.getItems()); } + }