This project has moved and is read-only. For the latest updates, please go here.

PhotoSearch returns empty dates

Topics: Developer Forum
Sep 5, 2012 at 12:15 AM
Does anyone know why the dates returned from the photo search below are always empty?

    PhotoSearchOptions options = new PhotoSearchOptions();     options.PerPage = 2;     options.Page = 1;     options.SortOrder = PhotoSearchSortOrder.DatePostedDescending;     options.MediaType = MediaType.Photos;     options.Extras = PhotoSearchExtras.Description;     options.Tags = "PatrickChan";     options.UserId = Settings.Default.FlickrUserId;     //Todo: Flickr API Query with Tag spaces     //Todo: Flickr API Photosearch doesn't return dates.     Flickr.CacheDisabled = true;     Flickr flickr = new Flickr(Settings.Default.FlickrApiKey, Settings.Default.FlickrSharedSecret);                      PhotoCollection photos = flickr.PhotosSearch(options);     foreach (Photo p in photos)     {         retVal.Add(new SCanMediaDetail { DateAdded = p.DateUploaded, Id = p.Small320Url, Title = p.Description, Media = SCanMediaType.FlickrImage });     }

Any help is greatly appreciated!
Sep 5, 2012 at 9:29 AM

DateTaken and DateUploaded are optional properties, and you must ask for them - just like you have with the Description:

options.Extras = PhotoSearchExtras.Description | PhotoSearchExtras.DateUploaded | PhotoSearchExtras.DateTaken;