Hello everyone,
I'm using Piwigo in my private network as central galery for the whole familiy. To improve acceptance by my wife I want to send every other day a memory from a couple years ago.
Sending the photo via my home automation is no issue, but I have trouble to get the picture-link(s) from Piwigo.
The easiest way to process would be the json output of the memories plugin API-method memories.photos.list. But I only get an PHP-Error and a empty answer, even on the memories-page the photos of the last years are displayed correctly. Maybe a bug?
Does anyone maybe see another solution to fetch the links of photos from x years ago? I just need the id or the link of the photos to download them to my home automation server which then sends it with a telegram bot.
btw. my gallery is organized by day - so every day has its own album, maybe i can ask for a specific album like "give me all pictures of album YYYY-MM-DD" ?
My HTTP-Request:
https://nas.spielkinder.lokal/piwigo/ws.php?format=json&method=memories.photos.list&years=5
The answer of piwigo (getting the same answer no matter what year I'm requesting):
<br /> <b>Notice</b>: Undefined index: memodate in <b>/var/www/html/piwigo/plugins/memories/include/function.pfoya.inc.php</b> on line <b>111</b><br /> {"stat":"ok","result":null}
I also tried XML-output, without SSL, logged in/logged out
My environment:
Piwigo 12.3.0 Prüfen, ob eine neue Version verfügbar ist.
Betriebssystem: Linux
PHP: 7.4.30 (Info anzeigen) [2022-10-06 14:05:39]
MySQL: 5.5.5-10.5.15-MariaDB-0+deb11u1 [2022-10-06 14:05:39]
Grafikbibliothek: GD 2.3.0
Größe des Cache nicht vorhanden nie berechnet Aktualisieren
Plugins
Admin Tools
Batch Downloader
Memories (Version: 12.0.a)
OpenStreetMap
Take A Tour of Your Piwigo
TravelMap
Piwigo URL: not public
Kind regards
Richard
Last edited by DerKoerper (2022-10-06 14:40:31)
Offline
Hi :-)
Are you sure API method memories.photos.list exist ?
Offline
Offline
The undefined memodate index notice message in your output looks odd. That's exactly what the memories plugin expects in plugins/memories/include/function.pfoya.inc.php line 111 in function ws_memories_photos_list() but doesn't get passed. No idea how that is supposed to work. It seems to me that API method is meant to be used internally through plugins/memories/blockhome/stuffs_homepfoya.tpl so maybe you can figure out what exactly is to be passed there.
But as your albums are named YYYY-MM-DD you could also query the categories with pwg.categories.getList and parse the result for the desired date to obtain its category ID and then use pwg.categories.getImages to get the list of images of that category.
Offline
Yep, I also already tried to figure out what this line in function.pfoya.inc.php is meant to do, but without any results.
Okay, I looked for a "get Album" function, as I'm not using categories... But I just realized my albums are what is named categories there... my bad.
Thanks for your suggestion, I will check for a suitable request. I tried pwg.images.search as I didn't see any other possibility but this method is pretty inefficient.
Nonetheless: The API-method is not designed to work as i expect? It's a bit odd to me as there is a plausible description on the ws.htm. I would expect it either to work as API method or to not be displayed at all. See it as suggestion from a very happy Piwigo user ;-) .
Thanks for the help to this point!
Offline