Feature 041: supply title/description at upload time; return expected_id in response#4385
Merged
Merged
Conversation
…ng docs Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
…stions.md Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
…n doc, and open-questions Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LycheeOrg/Lychee/sessions/82663c4f-6e7e-4d20-b22a-5a87f3a60171 Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
…d var) Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
Copilot
AI
changed the title
Feature 041: Upload Photo Metadata (title, description, expected_id)
Feature 041: supply title/description at upload time; return expected_id in response
May 31, 2026
Copilot created this pull request from a session on behalf of
ildyria
May 31, 2026 22:09
View session
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Callers currently must make a second API call to set
title/descriptionafter upload. This wires those fields directly into the upload request and returns anexpected_idso clients know the photo's ID before async processing completes.HTTP layer
UploadPhotoRequest: addstitle(max 100) anddescription(max 1 000) optional fields withTitleRule/DescriptionRulevalidationUploadMetaResource: gains?string $expected_id,?string $title,?string $descriptionPhotoController::upload(): generates a 24-char Base64urlexpected_idon the final non-zip chunk (same algorithm asgenerateKey()); forwards all three fields intoProcessImageJobDTO chain
ImportParam → InitDTO → StandaloneDTOeach gain?string $title,?string $description,?string $preallocated_id(nullable, defaultnull; backward-compatible).Pipeline
ApplyUserProvidedMetadatapipe inserted beforeHydrateMetadata— assigns caller-suppliedtitle/descriptionto the photo so EXIF cannot overwrite themAutoRenamer: returns early when$state->title !== nullID pre-allocation
Photo::preallocateId(string $id)stores the caller-chosen IDHasRandomIDAndLegacyTimeBasedID::generateKey()consumes it on first insert then clears it; falls back to a fresh random ID on DB collision (soexpected_idis best-effort, not guaranteed)Tests
UploadWithMetadataTest(9 tests, 466 assertions) covering title/description override, EXIF fallback,expected_idmatch, duplicate 409 (skip_duplicates=true), zip nullexpected_id, validation limits, and AutoRenamer skip.