mirror of
https://github.com/Xevion/simple-viewer.git
synced 2025-12-06 21:16:32 -06:00
basic site design, directory path reading, uuid setup, file icon mimetype categorization
This commit is contained in:
8
viewer/helpers.py
Normal file
8
viewer/helpers.py
Normal file
@@ -0,0 +1,8 @@
|
||||
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'
|
||||
Reference in New Issue
Block a user