From: David ‘Bombe’ Roden Date: Wed, 23 Mar 2011 06:02:04 +0000 (+0100) Subject: Add “album image” to album. X-Git-Tag: beta-freefall-0.6.2-1~84 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=98b7cdc041f13752faa5c644fb6e1cf3eb7962ee;p=Sone.git Add “album image” to album. --- 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