Support audio attachments
This commit is contained in:
parent
ba1c694294
commit
452de34780
4 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -1497,6 +1497,7 @@ components:
|
|||
- unknown
|
||||
- image
|
||||
- video
|
||||
- audio
|
||||
url:
|
||||
description: The location of the original full-size attachment.
|
||||
type: string
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue