Skip to content

Mpeg4 audio files can not be "viewed" with the fileservice #101

@jsvrcek

Description

@jsvrcek

Mpeg4 Audio files (.m4a) cannot be "viewed" with the fileservice. This is because the view function in api.py uses mime_type = mime.guess_type(url), and the mime_types dict (as of python 2.7.11) doesn't include a mapping for m4a. A simple solution (tested) could be:

mime_type = mime.guess_type(url)
# If mime_type is unknown, add a known file type.
if not mime_type[0]:
    file_ext = os.path.splitext(url)[1]
    if file_ext == '.mp4':
        mime_type = ('audio/mp4',None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions