Replies: 2 comments 1 reply
-
That Even for testing, the way I had to resolve it so far was by: uploading to the root folder (assumption that unsorted is empty) and then querying the content: $response = $this->actingAs($this->admin)->upload('Photo', filename: $filename);
$this->assertCreated($response);
$this->clearCachedSmartAlbums();
$response = $this->getJsonWithData('Album', ['album_id' => 'unsorted']);
$this->assertOk($response);
return $response->json('resource.photos.0');The code to process the photo can be found here: Which subsequently creates a
It passes through pipes and ends up with : |
Beta Was this translation helpful? Give feedback.
-
|
I should be able to use the empty Unsorted approach for this. That hadn't occurred to me and it seems like a good-enough workaround. The async pipeline problem is what I suspected, but there might be a simple way to deal with that: report the on-upload ID as Then, with another query, let them poll to see where in the process it is. I presume In the event of a duplicate or another problem, keeping notes probably wouldn't occupy too much storage, so maybe the result could live in cache until flushed, so that new check endpoint could provide enough context for full automation, and yet another endpoint could acknowledge and clear the record. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am writing a script to migrate some images from another system to Lychee and I have been successful in using the
/api/v2/Photoendpoint to upload files to a specific album, and what I get back is, as documented,{'file_name': '[omitted]', 'extension': '.png', 'uuid_name': 'cc4uexJLtXD2nJam.png', 'stage': 'done', 'chunk_number': 1, 'total_chunks': 1}But what I want to do next is apply descriptions and tags to this image, such as through
/api/v2/Photo::tags, and these require a Photo ID. Initially, I assumed this would beuuid_namebecause it appears to be the only ID-like identifier assigned as part of the upload, but I was met with the response"photo_ids.0 must be a string in Base64-encoding with 24 characters".Looking at the web UI, I can see that the URL for the uploaded image has a string in this format and it is nothing like the
uuid_namevalue, which is 16 characters (seemingly Base64) plus an extension.I have tried
/api/v2/Mapwith the intent of searching foruuid_namein the list of photos, since I don't need this to be fast, just reliable, but thephotoarray I see is empty when using the same Album ID as when uploading.It is entirely possible that there is an intended way to get the Photo ID after it has been uploaded, and maybe it can't be known immediately because it needs to be processed or checked for duplicates or something asynchronously, but whatever the path to getting the Photo ID is, I am afraid that I cannot find it.
If someone could provide directions, I'd be willing to try to add hints to the API documentation to make it clearer for the next person; this seems like a fairly common use-case.
Beta Was this translation helpful? Give feedback.
All reactions