mirror of https://gitlab.com/bashrc2/epicyon
Instance metadata about supported mime types
parent
5c558b1ca0
commit
e8b589db14
52
metadata.py
52
metadata.py
|
@ -102,7 +102,10 @@ def metaDataInstance(showAccounts: bool,
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
isBot = False
|
isBot = False
|
||||||
if adminActor['type'] != 'Person':
|
isGroup = False
|
||||||
|
if adminActor['type'] == 'Group':
|
||||||
|
isGroup = True
|
||||||
|
elif adminActor['type'] != 'Person':
|
||||||
isBot = True
|
isBot = True
|
||||||
|
|
||||||
url = \
|
url = \
|
||||||
|
@ -116,16 +119,27 @@ def metaDataInstance(showAccounts: bool,
|
||||||
activeAccounts = 1
|
activeAccounts = 1
|
||||||
localPosts = 1
|
localPosts = 1
|
||||||
|
|
||||||
|
createdAt = ''
|
||||||
|
if adminActor.get('published'):
|
||||||
|
createdAt = adminActor['published']
|
||||||
|
|
||||||
|
rulesList = []
|
||||||
|
|
||||||
instance = {
|
instance = {
|
||||||
'approval_required': False,
|
'approval_required': False,
|
||||||
|
'invites_enabled': False,
|
||||||
|
'registrations': registration,
|
||||||
'contact_account': {
|
'contact_account': {
|
||||||
'acct': adminActor['preferredUsername'],
|
'acct': adminActor['preferredUsername'],
|
||||||
|
'created_at': createdAt,
|
||||||
'avatar': adminActor['icon']['url'],
|
'avatar': adminActor['icon']['url'],
|
||||||
'avatar_static': adminActor['icon']['url'],
|
'avatar_static': adminActor['icon']['url'],
|
||||||
'bot': isBot,
|
|
||||||
'display_name': adminActor['name'],
|
|
||||||
'header': adminActor['image']['url'],
|
'header': adminActor['image']['url'],
|
||||||
'header_static': adminActor['image']['url'],
|
'header_static': adminActor['image']['url'],
|
||||||
|
'bot': isBot,
|
||||||
|
'discoverable': True,
|
||||||
|
'group': isGroup,
|
||||||
|
'display_name': adminActor['name'],
|
||||||
'locked': adminActor['manuallyApprovesFollowers'],
|
'locked': adminActor['manuallyApprovesFollowers'],
|
||||||
'note': '<p>Admin of ' + domain + '</p>',
|
'note': '<p>Admin of ' + domain + '</p>',
|
||||||
'url': url,
|
'url': url,
|
||||||
|
@ -133,10 +147,9 @@ def metaDataInstance(showAccounts: bool,
|
||||||
},
|
},
|
||||||
'description': instanceDescription,
|
'description': instanceDescription,
|
||||||
'languages': [systemLanguage],
|
'languages': [systemLanguage],
|
||||||
'registrations': registration,
|
|
||||||
'short_description': instanceDescriptionShort,
|
'short_description': instanceDescriptionShort,
|
||||||
'stats': {
|
'stats': {
|
||||||
'domain_count': 1,
|
'domain_count': 2,
|
||||||
'status_count': localPosts,
|
'status_count': localPosts,
|
||||||
'user_count': activeAccounts
|
'user_count': activeAccounts
|
||||||
},
|
},
|
||||||
|
@ -144,7 +157,34 @@ def metaDataInstance(showAccounts: bool,
|
||||||
'title': instanceTitle,
|
'title': instanceTitle,
|
||||||
'uri': domainFull,
|
'uri': domainFull,
|
||||||
'urls': {},
|
'urls': {},
|
||||||
'version': version
|
'version': version,
|
||||||
|
'rules': rulesList,
|
||||||
|
'configuration': {
|
||||||
|
'statuses': {
|
||||||
|
'max_media_attachments': 1
|
||||||
|
},
|
||||||
|
'media_attachments': {
|
||||||
|
'supported_mime_types': [
|
||||||
|
'image/jpeg',
|
||||||
|
'image/png',
|
||||||
|
'image/gif',
|
||||||
|
'image/webp',
|
||||||
|
'image/avif',
|
||||||
|
'image/svg+xml',
|
||||||
|
'video/webm',
|
||||||
|
'video/mp4',
|
||||||
|
'video/ogv',
|
||||||
|
'audio/ogg',
|
||||||
|
'audio/flac',
|
||||||
|
'audio/mpeg'
|
||||||
|
],
|
||||||
|
'image_size_limit': 10485760,
|
||||||
|
'image_matrix_limit': 16777216,
|
||||||
|
'video_size_limit': 41943040,
|
||||||
|
'video_frame_rate_limit': 60,
|
||||||
|
'video_matrix_limit': 2304000
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
|
|
Loading…
Reference in New Issue