From 98b7cdc041f13752faa5c644fb6e1cf3eb7962ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 23 Mar 2011 07:02:04 +0100 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9Calbum=20image=E2=80=9D=20to=20alb?= =?utf8?q?um.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/data/Album.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 4f52f50..16c9916 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -51,6 +51,9 @@ public class Album implements Fingerprintable { /** The description of this album. */ private String description; + /** The index of the album picture. */ + private int albumImage = -1; + /** * Creates a new album with a random ID. */ @@ -170,6 +173,19 @@ public class Album implements Fingerprintable { } /** + * Returns the album image of this album, or {@code null} if no album image + * has been set. + * + * @return The image to show when this album is listed + */ + public Image getAlbumImage() { + if (albumImage == -1) { + return null; + } + return images.get(albumImage); + } + + /** * Returns the parent album of this album. * * @return The parent album of this album, or {@code null} if this album -- 2.7.4