From: David ‘Bombe’ Roden Date: Tue, 18 Feb 2020 15:45:21 +0000 (+0100) Subject: 🔥 Remove IMAGES from Album interface X-Git-Tag: v82^2~54 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=70ed282fe7a7146a8abb92450ceca75f90c20ba6;p=Sone.git 🔥 Remove IMAGES from Album interface --- diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 3eefc3e..bf8f3ec 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -17,27 +17,13 @@ package net.pterodactylus.sone.data; -import java.util.Collections; import java.util.List; -import javax.annotation.Nonnull; - -import com.google.common.base.Function; /** * Container for images that can also contain nested {@link Album}s. */ public interface Album extends Identified, Fingerprintable { - /** Function that transforms an album into the images it contains. */ - Function> IMAGES = new Function>() { - - @Override - @Nonnull - public List apply(Album album) { - return (album != null) ? album.getImages() : Collections.emptyList(); - } - }; - /** * Returns the ID of this album. * diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index 06922fc..b072dc9 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -18,8 +18,6 @@ package net.pterodactylus.sone.template; import static java.util.logging.Logger.getLogger; -import static java.util.stream.Collectors.toList; -import static net.pterodactylus.sone.data.Album.IMAGES; import java.util.logging.Level; import java.util.logging.Logger; @@ -115,7 +113,7 @@ public class SoneAccessor extends ReflectionAccessor { } return trust; } else if (member.equals("allImages")) { - return SoneKt.getAllAlbums(sone).stream().flatMap(a -> IMAGES.apply(a).stream()).collect(toList()); + return SoneKt.getAllImages(sone); } else if (member.equals("albums")) { return sone.getRootAlbum().getAlbums(); }