Special handling for csv mimetype files.

This commit is contained in:
Roland 2022-12-14 19:14:19 -07:00
parent 3751ed7999
commit 94e4cce1f2
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -101,10 +101,13 @@ def _mimetype_suffix_map(path: Path, mimetype: str):
suffix = path.suffix.lower()
if mimetype == 'application/octet-stream' and suffix.endswith('.mobi'):
return MOBI_MIMETYPE
if mimetype == 'text/plain' and suffix.endswith('.json'):
return 'application/json'
if mimetype == 'text/plain' and suffix.endswith('.vtt'):
return 'text/vtt'
if mimetype == 'text/plain':
if suffix.endswith('.json'):
return 'application/json'
if suffix.endswith('.vtt'):
return 'text/vtt'
if suffix.endswith('.csv'):
return 'text/csv'
return mimetype