Update information about dicts (media colors, card blurhash)

This commit is contained in:
halcy 2022-11-13 13:35:38 +02:00
parent fdb6e2a140
commit c670ed8ce2
3 changed files with 18 additions and 5 deletions

View File

@ -16,7 +16,7 @@ Refer to mastodon changelog and API docs for details when implementing, add or m
----- -----
* [ ] Add personal notes for accounts * [ ] Add personal notes for accounts
* [x] Add customizable thumbnails for audio and video attachments * [x] Add customizable thumbnails for audio and video attachments
* [ ] Add color extraction for thumbnails * [x] Add color extraction for thumbnails
3.3.0 3.3.0
----- -----

View File

@ -571,12 +571,12 @@ Media dicts
'remote_url': # The remote URL for the media (if the image is from a remote instance) 'remote_url': # The remote URL for the media (if the image is from a remote instance)
'preview_url': # The URL for the media preview 'preview_url': # The URL for the media preview
'text_url': # The display text for the media (what shows up in toots) 'text_url': # The display text for the media (what shows up in toots)
'meta': # Dictionary of two image metadata dicts (see below), 'meta': # Dictionary of two metadata dicts (see below),
# 'original' and 'small' (preview). Either may be empty. # 'original' and 'small' (preview). Either may be empty.
# May additionally contain an "fps" field giving a videos frames per second (possibly # May additionally contain an "fps" field giving a videos frames per second (possibly
# rounded), and a "length" field giving a videos length in a human-readable format. # rounded), and a "length" field giving a videos length in a human-readable format.
# Note that a video may have an image as preview. # Note that a video may have an image as preview.
# May also contain a 'focus' dict. # May also contain a 'focus' dict and a media 'colors' dict.
'blurhash': # The blurhash for the image, used for preview / placeholder generation 'blurhash': # The blurhash for the image, used for preview / placeholder generation
'description': # If set, the user-provided description for this media. 'description': # If set, the user-provided description for this media.
} }
@ -599,12 +599,24 @@ Media dicts
'bitrate': # Average bit-rate of the video in bytes per second 'bitrate': # Average bit-rate of the video in bytes per second
} }
# Metadata dicts (audio) - all fields are optional:
{
'duration': # Duration of the audio file in seconds
'bitrate': # Average bit-rate of the audio file in bytes per second
}
# Focus Metadata dict: # Focus Metadata dict:
{ {
'x': Focus point x coordinate (between -1 and 1) 'x': Focus point x coordinate (between -1 and 1)
'y': Focus point x coordinate (between -1 and 1) 'y': Focus point x coordinate (between -1 and 1)
} }
# Media colors dict:
{
'foreground': # Estimated foreground colour for the attachment thumbnail
'background': # Estimated background colour for the attachment thumbnail
'accent': # Estimated accent colour for the attachment thumbnail
Card dicts Card dicts
~~~~~~~~~~ ~~~~~~~~~~
.. _card dict: .. _card dict:
@ -629,6 +641,7 @@ Card dicts
'html': # HTML string of the embed 'html': # HTML string of the embed
'provider_name': # Name of the provider from which the embed originates 'provider_name': # Name of the provider from which the embed originates
'provider_url': # URL pointing to the embeds provider 'provider_url': # URL pointing to the embeds provider
'blurhash': # (optional) Blurhash of the preview image
} }
Search result dicts Search result dicts

View File

@ -208,7 +208,7 @@ class Mastodon:
# Dict versions # Dict versions
__DICT_VERSION_APPLICATION = "2.7.2" __DICT_VERSION_APPLICATION = "2.7.2"
__DICT_VERSION_MENTION = "1.0.0" __DICT_VERSION_MENTION = "1.0.0"
__DICT_VERSION_MEDIA = "2.8.2" __DICT_VERSION_MEDIA = "3.2.0"
__DICT_VERSION_ACCOUNT = "3.1.0" __DICT_VERSION_ACCOUNT = "3.1.0"
__DICT_VERSION_POLL = "2.8.0" __DICT_VERSION_POLL = "2.8.0"
__DICT_VERSION_STATUS = bigger_version(bigger_version(bigger_version(bigger_version(bigger_version("3.1.0", __DICT_VERSION_MEDIA), __DICT_VERSION_ACCOUNT), __DICT_VERSION_APPLICATION), __DICT_VERSION_MENTION), __DICT_VERSION_POLL) __DICT_VERSION_STATUS = bigger_version(bigger_version(bigger_version(bigger_version(bigger_version("3.1.0", __DICT_VERSION_MEDIA), __DICT_VERSION_ACCOUNT), __DICT_VERSION_APPLICATION), __DICT_VERSION_MENTION), __DICT_VERSION_POLL)
@ -219,7 +219,7 @@ class Mastodon:
__DICT_VERSION_NOTIFICATION = bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS) __DICT_VERSION_NOTIFICATION = bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS)
__DICT_VERSION_CONTEXT = bigger_version("1.0.0", __DICT_VERSION_STATUS) __DICT_VERSION_CONTEXT = bigger_version("1.0.0", __DICT_VERSION_STATUS)
__DICT_VERSION_LIST = "2.1.0" __DICT_VERSION_LIST = "2.1.0"
__DICT_VERSION_CARD = "2.0.0" __DICT_VERSION_CARD = "3.2.0"
__DICT_VERSION_SEARCHRESULT = bigger_version(bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS), __DICT_VERSION_HASHTAG) __DICT_VERSION_SEARCHRESULT = bigger_version(bigger_version(bigger_version("1.0.0", __DICT_VERSION_ACCOUNT), __DICT_VERSION_STATUS), __DICT_VERSION_HASHTAG)
__DICT_VERSION_ACTIVITY = "2.1.2" __DICT_VERSION_ACTIVITY = "2.1.2"
__DICT_VERSION_REPORT = "2.9.1" __DICT_VERSION_REPORT = "2.9.1"