X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FAlbumAccessor.java;h=19b600e56b539d016baedd7fbad4304c63fb0ef2;hb=5b6ead5721c404ab629187a03a7590824f93bd4d;hp=fcd7a70d5fc17f03707cc7102cc2c830c96ccf43;hpb=c2e868714435ac7c75d77d1911d0dfb00393d051;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 fcd7a70..19b600e 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â2019 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