Closed ericchapman80 closed 1 year ago
Hi @ericchapman80, thanks for the kind words! :) syno-photo-frame by itself is purely a client app to Synology Photos, so it doesn't act as a server of any URL. Do you mean if there's a way to access a specific photo in Synology Photos via a URL? If so, then yes, but depending on what your use case is, it may or may not be sufficient.
This function sends a GET request to Synology Photos API to fetch a photo.
Basically, when you share an album via a share link, the link may look something like
https://example.nas/photo/mo/sharing/ABCD12345
The "example.nas/photo/mo/sharing" part is an API path, the ABCD12345 part is a sharing id of the album. So to get to a particular photo, you need to send a GET request to the API in the following form:
https://{API_PATH}/webapi/entry.cgi?api=SYNO.Foto.Thumbnail&method=get&version=2&_sharing_id={SHARING_ID}&id={PHOTO_ID}&cache_key={CACHE_KEY}&type=unit&size=xl
You already have API_PATH and SHARING_ID. Values for PHOTO_ID and CACHE_KEY uniquely identify a photo in the album. You get them sending POST requests to the API to list album contents, but this in turn requires establishing a session first. So in the end, what my app does is it sends 3 or 4 POST requests to find out all the necessary variables, and then a GET request to obtain a photo. If you go through this process yourself then the final URL to get the photo is (I think) constant and doesn't change anymore. So if you only need one photo for your project, then once you have the URL it should work.
The easiest way to find out the values could be to run syno-photo-frame with Trace debugging:
RUST_LOG=trace ./syno-photo-frame {ALBUM SHARE LINK} | grep "syno_photo_frame::logging"
You can then see each request the app is sending and responses it gets from the API.
HTH :)
First off @Caleb9 awesome job on the project. I found your project and it adds a ton of functionality I found lacking on the synology photos app. I have a similar problem I'm trying to solve but instead of displaying photos on a photo album I'm using a RaspberryPi3 to display a Dakboard for our family calendar. It has photo integrations to display photos from popular storage such as Dropbox, Apple Photos, Flickr, Google Drive etc. The functionality I'm trying to leverage is the "custom url" where it can display a photo.
Does the syno-photo-frame serve a http(s) url that I could leverage for this functionality? If not, I believe you have the connectivity and information needed for me to use as a foundation.
Thank you in advance.