Support optional highlight names for uploaded photo batches

This commit is contained in:
2026-09-19 14:56:25 +03:30
parent 86dcfd71cb
commit f4037695a1
4 changed files with 65 additions and 9 deletions
+10 -4
View File
@@ -1,6 +1,6 @@
# iPhone → blog, with GitHub Actions
Photos → Share → **Publish to blog** → optional caption → upload.
Photos → Share → **Publish to blog** → optional caption and highlight name → upload.
The authenticated upload service converts photos to JPEG (maximum 2560 px), applies
orientation, converts embedded color profiles to sRGB, and strips public metadata.
@@ -130,14 +130,17 @@ Create **Publish to blog**:
1. Enable **Show in Share Sheet**, accepting **Images**.
2. **Ask for Input** (Text): “Caption (optional)”.
3. **Get Contents of URL**: `https://theread.me/api/photos`.
3. Add another **Ask for Input** (Text): “Highlight name (optional)”.
4. **Get Contents of URL**: `https://theread.me/api/photos`.
- Method: **POST**.
- Header: `Authorization` = `Bearer YOUR_TOKEN`.
- Request Body: **Form**.
- `photos`: type **File**, value **Shortcut Input** (the selected images).
- `caption`: type **Text**, value the caption response.
- `highlight`: type **Text**, value the highlight-name response. Select each
prompt's specific output variable so the caption and highlight stay separate.
- Do not set Content-Type; Shortcuts supplies the multipart boundary.
4. Show “Uploaded; publishing” on success. Optionally poll the returned `status_url`
5. Show “Uploaded; publishing” on success. Optionally poll the returned `status_url`
with the same header. `pushed` means “GitHub Actions is building/deploying”;
only `published` means the deployed site's receipt contains this album.
@@ -145,6 +148,8 @@ Multi-photo albums require repeated `photos` parts in one request. Verify that
file-list behavior on the target iPhone, starting with one photo and then two.
Select still photos; videos/Live Photo video components aren't supported. Dates
are upload time in UTC; captions are plain text. A caption is optional.
An optional highlight name (up to 200 characters) adds one link to **Highlights**,
pointing to the first photo in the batch. Leave it blank for an ordinary upload.
The token is visible in the shortcut editor; remove it before sharing the shortcut.
Rotate it by replacing the token file and recreating the upload container with
@@ -155,11 +160,12 @@ Rotate it by replacing the token file and recreating the upload container with
All API routes require the bearer token:
- `POST /api/photos`: 1–20 multipart `photos`, optional `caption` (4000 characters).
Optional `highlight` (200 characters) names a Highlights link to the batch's first photo.
Maximum request 100 MiB; each photo at most 60 megapixels.
- `GET /api/photos/<id>`: `queued`, `publishing`, `pushed`, `published`, or `failed`.
- `POST /api/photos/<id>/retry`: retry a failed Git publication.
Identical original bytes, ordering, and caption produce the same ID. Retrying does
Identical original bytes, ordering, caption, and highlight name produce the same ID. Retrying does
not duplicate entries or commits. Re-encoding or changing the caption creates a new
submission; edit an existing entry through Git. Keep the upload response/status URL.