API for photo albums

  
!Hubzilla Support Forum
Hi all,
I'm using the Zot API to build a sorted list of photos in an album. I found a solution with the /api/z/1.0/photos API but it is probably not ideal. It returns all the photos in the database. I then filter them with the album name and imgscale 1, etc... It is fine now that I have a few pictures only but I don't know if it will be usable once the number of photos grows.

Anybody has a better idea?

I'm converting some existing pages with lots of pictures to HZ. Adding the photos one by one from the albums is very tedious so I'm just automating things a bit. The zmg tag is easy since the database gives out the src with a full path. For a zrl tag, I think I need to construct it with resource_id and the path to the albums. I can hardcode the path for now but I'd rather do something that works on any HZ install.
  
Thanks for the tip. I'll have a look. I've not had a chance yet to try widgets or modifying the layout.
  last edited: Mon, 02 Apr 2018 22:03:28 +0200  
A possibly more efficient method would be to fetch /api/z/1.0/albums first to get the list of albums and then enumerate each of those with /api/z/1.0/photos?album=xxxxx replacing xxxxx with the urlencode: entry for each desired album
  
That's just what I was looking for. Thank you.