!Hubzilla Support ForumHi 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.

I didn't explain very well. Adding the photos to the albums is not a problem, with the upload tool or with WebDAV. It's adding correctly formatted links to those photos in a webpage that is painful. From the webpage editor, images can only be added one at a time, unless I missed some other way.

So my strategy was to have a script generate all the links for me, copy that into the page (or post) then add some text in between the images.

My script works reasonably well now but I still have a hardcoded path that I would like to get rid of. I'll publish the script and it should make more sense.

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