mirror of
https://github.com/Xevion/simple-viewer.git
synced 2025-12-06 01:16:24 -06:00
9 lines
297 B
Python
9 lines
297 B
Python
def get_mediatype(mimetype: str) -> str:
|
|
"""Simple media type categorization based on the given mimetype"""
|
|
if mimetype is not None:
|
|
if mimetype.startswith('image'):
|
|
return 'image'
|
|
elif mimetype.startswith('video'):
|
|
return 'video'
|
|
return 'file'
|