Permalink
Browse files

SOCIALFB-68: Capture cover_photo when fetching an Album.

  • Loading branch information...
1 parent 6a07ea5 commit 5020ca4d044dccd53201d53ce33812c016659514 Craig Walls committed Mar 13, 2012
@@ -45,6 +45,8 @@
private Date createdTime;
private Date updatedTime;
+
+ private String coverPhotoId;
private Album(String id, Reference from, String name, Type type, String link, int count, Privacy privacy, Date createdTime) {
this.id = id;
@@ -100,6 +102,14 @@ public Date getCreatedTime() {
public Date getUpdatedTime() {
return updatedTime;
}
+
+ /**
+ * The ID of the Photo object that is the cover photo for the album.
+ * @return A Photo object ID or null if the album does not have a cover photo
+ */
+ public String getCoverPhotoId() {
+ return coverPhotoId;
+ }
public static enum Type { NORMAL, MOBILE, PROFILE, WALL, FRIENDS_WALLS, UNKNOWN }
@@ -56,6 +56,9 @@
@JsonProperty("updated_time")
Date updatedTime;
+
+ @JsonProperty("cover_photo")
+ String coverPhotoId;
private static class TypeDeserializer extends JsonDeserializer<Type> {
@Override
@@ -442,6 +442,7 @@ private void assertSingleAlbum(Album album) {
assertEquals("Craig Walls", album.getFrom().getName());
assertEquals("http://www.facebook.com/album.php?aid=620722&id=738140579", album.getLink());
assertEquals("Early Broncos", album.getName());
+ assertEquals("10151447371355580", album.getCoverPhotoId());
assertNull(album.getDescription());
assertEquals("Somewhere", album.getLocation());
assertEquals(Album.Privacy.CUSTOM, album.getPrivacy());

0 comments on commit 5020ca4

Please sign in to comment.