X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FAlbumAccessor.java;h=52a9d88f8e7d3ffbdd699e32f3316b20ab4c1c04;hb=d35ab97a494fd187d3b8fe6b3253b65e3427a077;hp=13b4d65c766b6a6828c9ce36636f9e8446877374;hpb=7017646bf42cb265b6df539bb6def40b91d2f968;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/template/AlbumAccessor.java b/src/main/java/net/pterodactylus/sone/template/AlbumAccessor.java
index 13b4d65..52a9d88 100644
--- a/src/main/java/net/pterodactylus/sone/template/AlbumAccessor.java
+++ b/src/main/java/net/pterodactylus/sone/template/AlbumAccessor.java
@@ -34,21 +34,20 @@ import net.pterodactylus.util.template.TemplateContext;
*/
public class AlbumAccessor extends ReflectionAccessor {
- /**
- * {@inheritDoc}
- */
@Override
public Object get(TemplateContext templateContext, Object object, String member) {
Album album = (Album) object;
if ("backlinks".equals(member)) {
List backlinks = new ArrayList();
Album currentAlbum = album;
- while (!currentAlbum.equals(album.getSone().getRootAlbum())) {
+ while (!currentAlbum.isRoot()) {
backlinks.add(0, new Link("imageBrowser.html?album=" + currentAlbum.getId(), currentAlbum.getTitle()));
currentAlbum = currentAlbum.getParent();
}
backlinks.add(0, new Link("imageBrowser.html?sone=" + album.getSone().getId(), SoneAccessor.getNiceName(album.getSone())));
return backlinks;
+ } else if ("albumImage".equals(member)) {
+ return album.getAlbumImage().orNull();
}
return super.get(templateContext, object, member);
}