Skip to content

Verify that the attached media conforms with Mastodon restrictions before submitting the final tweet #4

@babetoduarte

Description

@babetoduarte

Currently, TootNotify is able to truncate the attached media files to a maximum of 4 files (which is the maximum number of IMAGES allowed), and send the Toot without media if the set of media files provided generate an Exception for the API.

However, it does not actively know how many images, GIFs, video files, and audio files have been passed to be included in the Toot. This means it can not enforce Mastodon's restrictions on media attachment for Toots, and relies on the API to return error codes and messages.

The restrictions to be enforced are: a Toot may contain text and either:

  • one or more (maximum 4) image files, or
  • exactly one GIF image file, or
  • exactly one video file,
  • exactly one audio file

Lazy approach: make a function that checks the list of media_ids returned from uploading the media to Mastodon, and enforces these restrictions by only keeping the best permitted set of media files (this wastes bandwidth and uploads files to Mastodon that may be then discarded).

Proactive approach: make a function that checks the list of media files for their MIME types BEFORE submitting them to Mastodon, and only submit the best permitted set of media files, as per the above restrictions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions