Add accessor for all top-level albums of a Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Sep 2013 19:01:49 +0000 (21:01 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Sep 2013 19:01:49 +0000 (21:01 +0200)
src/main/java/net/pterodactylus/sone/template/SoneAccessor.java

index ab872d9..92be8e0 100644 (file)
@@ -118,6 +118,8 @@ public class SoneAccessor extends ReflectionAccessor {
                        return trust;
                } else if (member.equals("allImages")) {
                        return from(asList(sone.getRootAlbum())).transformAndConcat(FLATTENER).transformAndConcat(IMAGES);
+               } else if (member.equals("albums")) {
+                       return sone.getRootAlbum().getAlbums();
                }
                return super.get(templateContext, object, member);
        }