Fix #808: Advertise the list of supported upload extensions in the Nodeinfo endpoint

This commit is contained in:
Eliot Berriot 2019-05-02 13:15:33 +02:00
parent 2b7dac2175
commit 119df01335
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 10 additions and 0 deletions

View file

@ -39,6 +39,10 @@ AUDIO_EXTENSIONS_AND_MIMETYPE = [
EXTENSION_TO_MIMETYPE = {ext: mt for ext, mt in AUDIO_EXTENSIONS_AND_MIMETYPE}
MIMETYPE_TO_EXTENSION = {mt: ext for ext, mt in AUDIO_EXTENSIONS_AND_MIMETYPE}
SUPPORTED_EXTENSIONS = list(
sorted(set([ext for ext, _ in AUDIO_EXTENSIONS_AND_MIMETYPE]))
)
def get_ext_from_type(mimetype):
return MIMETYPE_TO_EXTENSION.get(mimetype)