diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d943f2..a581abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added `registration.default_role` configuration option. - Save emojis attached to actor objects. - Added `emojis` field to Mastodon API Account entity. +- Support audio attachments. ### Changed diff --git a/docs/openapi.yaml b/docs/openapi.yaml index feefc06..fec57ff 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -1497,6 +1497,7 @@ components: - unknown - image - video + - audio url: description: The location of the original full-size attachment. type: string diff --git a/src/mastodon_api/media/types.rs b/src/mastodon_api/media/types.rs index de8a387..22ab455 100644 --- a/src/mastodon_api/media/types.rs +++ b/src/mastodon_api/media/types.rs @@ -33,6 +33,7 @@ impl Attachment { AttachmentType::Unknown => "unknown", AttachmentType::Image => "image", AttachmentType::Video => "video", + AttachmentType::Audio => "audio", }; let attachment_url = get_file_url( base_url, diff --git a/src/models/attachments/types.rs b/src/models/attachments/types.rs index 52f6a92..1936335 100644 --- a/src/models/attachments/types.rs +++ b/src/models/attachments/types.rs @@ -19,6 +19,7 @@ pub enum AttachmentType { Unknown, Image, Video, + Audio, } impl AttachmentType { @@ -29,6 +30,8 @@ impl AttachmentType { Self::Image } else if media_type.starts_with("video/") { Self::Video + } else if media_type.starts_with("audio/") { + Self::Audio } else { Self::Unknown }