X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FAlbumAccessor.java;h=87378ccbab5229c5e2d886b3e26ed67be855e1a8;hb=ecfd4c5a91d204ce4c001d19fa600cf42ac4cf43;hp=50934424e04053548ac338abe4426d170546c065;hpb=d9206828d23e4c0092499c46ffd75f6792c928bc;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 5093442..87378cc 100644
--- a/src/main/java/net/pterodactylus/sone/template/AlbumAccessor.java
+++ b/src/main/java/net/pterodactylus/sone/template/AlbumAccessor.java
@@ -1,5 +1,5 @@
/*
- * Sone - AlbumAccessor.java - Copyright © 2011â2015 David Roden
+ * Sone - AlbumAccessor.java - Copyright © 2011â2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,8 +31,6 @@ import net.pterodactylus.util.template.TemplateContext;
* {@link Accessor} implementation for {@link Album}s. A property named
* âbacklinksâ is added, it returns links to all parents and the owner Sone of
* an album.
- *
- * @author David âBombeâ Roden
*/
public class AlbumAccessor extends ReflectionAccessor {
@@ -45,7 +43,7 @@ public class AlbumAccessor extends ReflectionAccessor {
public Object get(TemplateContext templateContext, Object object, String member) {
Album album = (Album) object;
if ("backlinks".equals(member)) {
- List backlinks = new ArrayList();
+ List backlinks = new ArrayList<>();
Album currentAlbum = album;
while (!currentAlbum.isRoot()) {
backlinks.add(0, new Link("imageBrowser.html?album=" + currentAlbum.getId(), currentAlbum.getTitle()));
@@ -53,7 +51,7 @@ public class AlbumAccessor extends ReflectionAccessor {
}
backlinks.add(0, new Link("imageBrowser.html?sone=" + album.getSone().getId(), SoneAccessor.getNiceName(album.getSone())));
return backlinks;
- } else if ("randomImage".equals(member)) {
+ } else if ("albumImage".equals(member)) {
List images = album.getImages();
return images.isEmpty() ? null : images.get(random.nextInt(images.size()));
}
@@ -62,8 +60,6 @@ public class AlbumAccessor extends ReflectionAccessor {
/**
* Container for links.
- *
- * @author David âBombeâ Roden
*/
private static class Link {