chore: remove deprecated demo make target and update attachment thumbnail resolution

- Remove `make demo` target from Makefile, AGENTS.md, and README.md
- Improve `_row_to_attachment` to glob for thumbnail files with any extension instead of hardcoding `.jpg`
- Rewrite `cmd_attachments_prune` to use time-based cutoff and `delete_attachment` helper instead of orphan detection
- Add cursor-based pagination to feed and notifications endpoints with `before` parameter
- Track `did_upvote` flag in vote handler to only notify on new upvotes, not vote changes
- Add `PAGE_SIZE` constant and `next_cursor` template variable to notifications page
- Implement Playwright tests for notification pagination with 30 seeded notifications
This commit is contained in:
2026-05-28 22:45:07 +00:00
parent a8466da5b2
commit 4cdf49cf8f
10 changed files with 121 additions and 60 deletions
+5 -1
View File
@@ -250,7 +250,11 @@ def get_attachments_batch(target_type, uids):
def _row_to_attachment(row):
stored_name = row.get("stored_name", "")
directory = row.get("directory", "")
thumb_name = f"{Path(stored_name).stem}_thumb.jpg" if row.get("has_thumbnail") else None
thumb_name = None
if row.get("has_thumbnail"):
stem = Path(stored_name).stem
matches = sorted((ATTACHMENTS_DIR / directory).glob(f"{stem}_thumb.*"))
thumb_name = matches[0].name if matches else f"{stem}_thumb.jpg"
return {
"uid": row["uid"],
"original_filename": row.get("original_filename", ""),