Skip to content

Commit cf78db9

Browse files
author
tague
committed
Merge remote-tracking branch 'upstream/master'
2 parents 3521694 + 8d6bf46 commit cf78db9

4 files changed

Lines changed: 556 additions & 523 deletions

File tree

Flickr4Java/src/main/java/com/flickr4java/flickr/people/PeopleInterface.java

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
/**
3232
* Interface for finding Flickr users.
33-
*
33+
*
3434
* @author Anthony Eden
3535
* @version $Id: PeopleInterface.java,v 1.28 2010/09/12 20:13:57 x-mago Exp $
3636
*/
@@ -70,9 +70,9 @@ public PeopleInterface(String apiKey, String sharedSecret, Transport transportAP
7070

7171
/**
7272
* Find the user by their email address.
73-
*
73+
*
7474
* This method does not require authentication.
75-
*
75+
*
7676
* @param email
7777
* The email address
7878
* @return The User
@@ -98,9 +98,9 @@ public User findByEmail(String email) throws FlickrException {
9898

9999
/**
100100
* Find a User by the username.
101-
*
101+
*
102102
* This method does not require authentication.
103-
*
103+
*
104104
* @param username
105105
* The username
106106
* @return The User object
@@ -126,9 +126,9 @@ public User findByUsername(String username) throws FlickrException {
126126

127127
/**
128128
* Get info about the specified user.
129-
*
129+
*
130130
* This method does not require authentication.
131-
*
131+
*
132132
* @param userId
133133
* The user ID
134134
* @return The User object
@@ -175,12 +175,12 @@ public User getInfo(String userId) throws FlickrException {
175175

176176
/**
177177
* Get a collection of public groups for the user.
178-
*
178+
*
179179
* The groups will contain only the members nsid, name, admin and eighteenplus. If you want the whole group-information, you have to call
180180
* {@link com.flickr4java.flickr.groups.GroupsInterface#getInfo(String)}.
181-
*
181+
*
182182
* This method does not require authentication.
183-
*
183+
*
184184
* @param userId
185185
* The user ID
186186
* @return The public groups
@@ -219,9 +219,9 @@ public PhotoList<Photo> getPublicPhotos(String userId, int perPage, int page) th
219219

220220
/**
221221
* Get a collection of public photos for the specified user ID.
222-
*
222+
*
223223
* This method does not require authentication.
224-
*
224+
*
225225
* @see com.flickr4java.flickr.photos.Extras
226226
* @param userId
227227
* The User ID
@@ -274,9 +274,9 @@ public PhotoList<Photo> getPublicPhotos(String userId, Set<String> extras, int p
274274

275275
/**
276276
* Get upload status for the currently authenticated user.
277-
*
277+
*
278278
* Requires authentication with 'read' permission using the new authentication API.
279-
*
279+
*
280280
* @return A User object with upload status data fields filled
281281
* @throws FlickrException
282282
*/
@@ -359,20 +359,7 @@ public PhotoList<Photo> getPhotos(String userId, String safeSearch, Date minUplo
359359
NodeList photoNodes = photosElement.getElementsByTagName("photo");
360360
for (int i = 0; i < photoNodes.getLength(); i++) {
361361
Element photoElement = (Element) photoNodes.item(i);
362-
Photo photo = new Photo();
363-
photo.setId(photoElement.getAttribute("id"));
364-
photo.setSecret(photoElement.getAttribute("secret"));
365-
366-
User owner = new User();
367-
owner.setId(photoElement.getAttribute("owner"));
368-
photo.setOwner(owner);
369-
photo.setUrl("http://flickr.com/photos/" + owner.getId() + "/" + photo.getId());
370-
photo.setServer(photoElement.getAttribute("server"));
371-
photo.setTitle(photoElement.getAttribute("title"));
372-
photo.setPublicFlag("1".equals(photoElement.getAttribute("ispublic")));
373-
photo.setFriendFlag("1".equals(photoElement.getAttribute("isfriend")));
374-
photo.setFamilyFlag("1".equals(photoElement.getAttribute("isfamily")));
375-
photos.add(photo);
362+
photos.add(PhotoUtils.createPhoto(photoElement));
376363
}
377364
return photos;
378365
}
@@ -430,7 +417,7 @@ public PhotoList<Photo> getPhotosOf(String userId, String ownerId, Set<String> e
430417

431418
/**
432419
* Add the given person to the photo. Optionally, send in co-ordinates
433-
*
420+
*
434421
* @param photoId
435422
* @param userId
436423
* @param bounds
@@ -445,7 +432,7 @@ public void add(String photoId, String userId, Rectangle bounds) throws FlickrEx
445432

446433
/**
447434
* Delete the person from the photo
448-
*
435+
*
449436
* @param photoId
450437
* @param userId
451438
* @throws FlickrException
@@ -459,7 +446,7 @@ public void delete(String photoId, String userId) throws FlickrException {
459446

460447
/**
461448
* Delete the co-ordinates that the user is shown in
462-
*
449+
*
463450
* @param photoId
464451
* @param userId
465452
* @throws FlickrException
@@ -473,7 +460,7 @@ public void deleteCoords(String photoId, String userId) throws FlickrException {
473460

474461
/**
475462
* Edit the co-ordinates that the user shows in
476-
*
463+
*
477464
* @param photoId
478465
* @param userId
479466
* @param bounds
@@ -487,7 +474,7 @@ public void editCoords(String photoId, String userId, Rectangle bounds) throws F
487474
}
488475

489476
/**
490-
*
477+
*
491478
* @param photoId
492479
* @throws FlickrException
493480
*/
@@ -499,7 +486,7 @@ public UserList<User> getList(String photoId) throws FlickrException {
499486
}
500487

501488
/**
502-
*
489+
*
503490
* @param userId
504491
* @throws FlickrException
505492
*/

Flickr4Java/src/main/java/com/flickr4java/flickr/photos/SearchParameters.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,10 @@ public Map<String, Object> getAsParameters() {
592592
}
593593
}
594594

595+
if (placeId != null && !placeId.isEmpty()) {
596+
parameters.put("place_id", placeId);
597+
}
598+
595599
return parameters;
596600
}
597601

0 commit comments

Comments
 (0)