fix: Micropub photo posts and failed creates (v2.6.5)
- A create that failed after the note was written (e.g. the same photo twice) answered 500 but left the post published without photos. Photos are now resolved first, and a failed note is removed. - Pooled connections roll back unfinished writes, so one failure no longer locks the database for the next ~10 s. - The same photo twice in one post is shown once. - Photo posts no longer need text (Micropub doesn't require content, and q=config already advertised a photo-only post type). Updates may clear the text while photos remain. Crossposts start with the link; the page is titled "Photo". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d16463ef8a
commit
d0bfc80c2e
10 files changed
+247
-31
No files matched your search
@@ -1003,7 +1003,8 @@ def compose_text(note, permalink: str, tags: List[str], max_chars: int,
|
||||
if len(body) + len(tail) > max_chars:
|
||||
room = max_chars - len(tail) - 1
|
||||
body = body[:room].rsplit(" ", 1)[0].rstrip() + "…"
|
||||
return body + tail
|
||||
# A photo post may have no text: start with the link (v2.6.5)
|
||||
return (body + tail).lstrip()
|
||||
|
||||
|
||||
_BLOCKS = ["p", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "blockquote", "ul", "ol", "hr", "table"]
|
||||
|
||||
Reference in new issue
Block a user