Skip to content

Allow more than 4 attachments per status in the backend#9325

Closed
ClearlyClaire wants to merge 1 commit intomastodon:masterfrom
ClearlyClaire:fixes/media-attachment-improvements
Closed

Allow more than 4 attachments per status in the backend#9325
ClearlyClaire wants to merge 1 commit intomastodon:masterfrom
ClearlyClaire:fixes/media-attachment-improvements

Conversation

@ClearlyClaire
Copy link
Copy Markdown
Contributor

This commit allows more than 4 attachments per status in the backend. Such attachments were already processed, but not attached to any status.

Marked as WiP because changes to the WebUI would be needed to make more sense:

  • Add a “and more” or something in the inline media gallery when there are more than 4 pics (the modal would allow seeing them all)
  • Add a way to access all media when there are more than one and the first is a video

@ClearlyClaire ClearlyClaire added the work in progress Not to be merged, currently being worked on label Nov 21, 2018
@Gargron
Copy link
Copy Markdown
Member

Gargron commented Nov 21, 2018

Even if they get processed, they get cleaned out later if they are not attached. I don't think this is a good idea

@ClearlyClaire
Copy link
Copy Markdown
Contributor Author

ClearlyClaire commented Nov 21, 2018 via email

@Gargron
Copy link
Copy Markdown
Member

Gargron commented Nov 23, 2018

  1. Storing more media attachments translates directly into hosting costs for admins, so limiting how much can be stored is very important.
  2. Especially since the UI is designed around displaying 4 attachments at most, having hidden but stored attachments is worse than simply cutting off attachments, because the invisible files could be big (or illegal)
  3. If you relax the processing limitations, people will absolutely take advantage of it. See: ridiculous character limits. It would be that, but worse, because of (1)

@ClearlyClaire
Copy link
Copy Markdown
Contributor Author

  1. Ok, that's a valid point, but receiving many media in one toot or in several toots do not make a big difference. Also, storage is one thing, processing is another, and for now we do a lot of useless processing.
  2. Yes, this PR is marked WiP because I intend to change that to some extent: my idea so far is, at least for the media gallery, to have a “And more” on the last item if there's more than 4, and the modal would allow to see them all.
  3. Processing isn't limited, only storage and delivery is, extra media are already processed but not attached to statuses. Pleroma already uses different limits than we do, especially for video (another thing I want to change, but I'm not quite sure how yet)

@Gargron
Copy link
Copy Markdown
Member

Gargron commented Nov 24, 2018

We could limit the number of processed attachments too

@trwnh
Copy link
Copy Markdown
Member

trwnh commented Nov 24, 2018

Perhaps the "and more" link would load the original post on the original domain? That could prevent Mastodon from having to cache infinite media while still signalling that more than 4 attachments exist.

@giromide
Copy link
Copy Markdown

To ThibG's first point just above, if someone wants to drop ten related images into their Mastodon instance, I'd much prefer to see them in one post than three.

@Gargron
Copy link
Copy Markdown
Member

Gargron commented Nov 27, 2018

Yes it's no secret to me that given absolute freedom people would dump 100-image albums, ZIP archives, ISO images and whatnot into their posts. What's good for the poster isn't necessarily good for the reader, or the hoster. The system is designed around these constraints. I say, chop it off after 4 processed attachments.

@trwnh
Copy link
Copy Markdown
Member

trwnh commented Nov 28, 2018

given absolute freedom, people would dump 100-image albums [...] and whatnot into their posts

Surely ignoring the freedom of other systems entirely is a bad move? Maybe vanilla Mastodon doesn't need to locally cache more than 4, but some admins will want to cache more, or host more, etc. At the very least, the existence of attachments should be acknowledged, even if it is not supported on the local instance.

@MirceaKitsune
Copy link
Copy Markdown

MirceaKitsune commented Jan 11, 2019

I'd like to see this change as well. Only 4 attachments per post is pretty limiting: By default I'd go with allowing something like 16, while of course letting only first 4 show up in the preview. If more than 4 attachments exist on the post, a text over the previews can indicate how many more... for instance if there are 7 attachments it would say "+3 more" (4 + 3 = 7).

A semi-related concern: Are mixed attachments officially supported? Can you attach both images, video, and audio in the same post? Ideally this can be allowed too with multiple attachments.

thread: replied_to_status,
conversation: conversation_from_uri(@object['conversation']),
media_attachment_ids: process_attachments.take(4).map(&:id),
media_attachment_ids: process_attachments.map(&:id),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you turn this into a PR that does not process more than 4 attachments? Most clients won't be able to display more than 4 right now, and the important thing is not storing stuff we don't use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work in progress Not to be merged, currently being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants