Sort (asc / desc) doesn't work

Reports about issues that you encounter in Photonic.

This forum is not actively monitored. For bug reports please post them to https://wordpress.org/support/plugin/photonic/.
Locked
AlexP6n
Posts: 7
Joined: 16 Oct 2012, 03:13

Sort (asc / desc) doesn't work

Post by AlexP6n » 24 Jan 2013, 07:29

Hi,

everything is working perfect- BUT the sorting of pictures in order.

This code

[gallery type='flickr' user_id='85434359@N08' photoset_id='72157631791146131' sort='date-posted-asc' per_page='6']

gives me the oldest pictures first - come what may, come what I put in there (asc / desc)..

How can I sort the pictures in the right order?

THANK YOU.

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Sort (asc / desc) doesn't work

Post by sayontan » 24 Jan 2013, 08:35

As per the API description, sorting doesn't work for photosets: http://www.flickr.com/services/api/flic ... hotos.html. There is no "sort" parameter there; it only works for photo search results.

AlexP6n
Posts: 7
Joined: 16 Oct 2012, 03:13

Re: Sort (asc / desc) doesn't work

Post by AlexP6n » 26 Jan 2013, 14:51

Thank you for your reply.

I would appreciate this feature indeed VERY much.
Can you include it for the next version?

It is an important option, because always seeing the oldest photos doesn't make any sense on any website I guess?

Thank you!

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Sort (asc / desc) doesn't work

Post by sayontan » 26 Jan 2013, 20:03

AlexP6n wrote:I would appreciate this feature indeed VERY much.
In that case you have to ask Flickr to do it instead of me :-)

I provided you with a link to the API from Flickr - they don't even provide the date a photo was taken with their API results. If Flickr builds this capability it is going to be just one API call from the plugin code. If I have to build it, it will mean several API calls more and might risk bringing down your server. E.g. if your photoset has 200 photos and you want the newest 20 photos, I have to first run 1 query to get all the 200 photos, then run 1 query for each of the 200 photos (the single photo API - http://www.flickr.com/services/api/flic ... tInfo.html - is the only one that gives the date the photo was taken), then sort by all the dates . So in effect, I have to execute 201 API calls to find the latest 20 photos. That kind of a performance hit is reason enough for being inducted into the hall of shame for coders.

Tl;dr: This feature cannot be provided unless Flickr modifies its API.

AlexP6n
Posts: 7
Joined: 16 Oct 2012, 03:13

Re: Sort (asc / desc) doesn't work

Post by AlexP6n » 01 Feb 2013, 08:01

Ok, I see.

thank you very much for the explanation!
sayontan wrote:As per the API description, sorting doesn't work for photosets: http://www.flickr.com/services/api/flic ... hotos.html. There is no "sort" parameter there; it only works for photo search results.
I just wonder why they give this possibility only in photo search results..

Anyway. thank you very much!

Locked