lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Gallery support

Open flamingos-cant opened this issue 8 months ago • 1 comments

Closes #981.

Galleries are a collection of images attached to a post. I wanted to have galleries reside within Post itself, but I couldn't work out how to do that, so they're just a top-level vec on PostView, basically a copy of how post tags work in #4997.

This doesn't introduce any API breaks, but there is some weirdness as Post's can now have a url_content_type but no url. This is so media filter setting excludes gallery from feeds where that's set.

On the AP side, galleries are just federated as multiple attachments. Also, Image attachments now have mediaType, to prevent every server having to fetch the content_type for all the images, and summary, to handle captions.

Things left to do:

  • [ ] Tests (API/unit)
  • [ ] Doc strings where needed
  • [ ] Generate thumbnails for gallery posts
  • [ ] Create wrapper structs so that galleries are passed to plugins along with the post
  • [x] Delete/purge galleries along with posts
  • [x] Limit the number of items a gallery can have (probably ~25)
  • [ ] Maybe find a way to include gallery's alt_text in search (ref #5449).

flamingos-cant avatar May 17 '25 06:05 flamingos-cant

This doesn't introduce any API breaks, but there is some weirdness as Post's can now have a url_content_type but no url. This is so media filter setting excludes gallery from feeds where that's set.

We could set content type to image/gallery in that case.

Nutomic avatar May 19 '25 10:05 Nutomic