X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FAlbumAccessor.java;h=87378ccbab5229c5e2d886b3e26ed67be855e1a8;hb=5c5bee980f9cab5792e34d1c9840f73b8b191830;hp=96891e5a52a23447022b3e328b38dc045344e352;hpb=6e9a43ccd93ae125720547c0fe421dc81a54ba90;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 96891e5..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â2013 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
@@ -18,11 +18,11 @@
package net.pterodactylus.sone.template;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
+import java.util.Random;
import net.pterodactylus.sone.data.Album;
+import net.pterodactylus.sone.data.Image;
import net.pterodactylus.util.template.Accessor;
import net.pterodactylus.util.template.ReflectionAccessor;
import net.pterodactylus.util.template.TemplateContext;
@@ -31,11 +31,11 @@ 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 {
+ private final Random random = new Random();
+
/**
* {@inheritDoc}
*/
@@ -43,36 +43,67 @@ public class AlbumAccessor extends ReflectionAccessor {
public Object get(TemplateContext templateContext, Object object, String member) {
Album album = (Album) object;
if ("backlinks".equals(member)) {
- List