projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add method to set the album image ID.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
data
/
Album.java
diff --git
a/src/main/java/net/pterodactylus/sone/data/Album.java
b/src/main/java/net/pterodactylus/sone/data/Album.java
index
7d22858
..
5e5d08a
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/data/Album.java
+++ b/
src/main/java/net/pterodactylus/sone/data/Album.java
@@
-53,8
+53,8
@@
public class Album implements Fingerprintable {
/** The description of this album. */
private String description;
/** The description of this album. */
private String description;
- /** The
index
of the album picture. */
- private
int albumImage = -1
;
+ /** The
ID
of the album picture. */
+ private
String albumImage
;
/**
* Creates a new album with a random ID.
/**
* Creates a new album with a random ID.
@@
-189,13
+189,25
@@
public class Album implements Fingerprintable {
* @return The image to show when this album is listed
*/
public Image getAlbumImage() {
* @return The image to show when this album is listed
*/
public Image getAlbumImage() {
- if (albumImage ==
-1
) {
+ if (albumImage ==
null
) {
return null;
}
return images.get(albumImage);
}
/**
return null;
}
return images.get(albumImage);
}
/**
+ * Sets the ID of the album image.
+ *
+ * @param id
+ * The ID of the album image
+ * @return This album
+ */
+ public Album setAlbumImage(String id) {
+ this.albumImage = id;
+ return this;
+ }
+
+ /**
* Returns whether this album contains any other albums or images.
*
* @return {@code true} if this album is empty, {@code false} otherwise
* Returns whether this album contains any other albums or images.
*
* @return {@code true} if this album is empty, {@code false} otherwise