mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 15:06:19 -05:00
Always fetching mimetype. Special handling for .stl files.
This commit is contained in:
parent
94e4cce1f2
commit
f7aaa1363c
2 changed files with 5 additions and 2 deletions
|
|
@ -813,8 +813,7 @@ def apply_modelers(files, session: Session):
|
|||
# Group all files by their common name (without the suffix).
|
||||
groups = {}
|
||||
for file in files:
|
||||
if not file.mimetype:
|
||||
file.mimetype = get_mimetype(file.path)
|
||||
file.mimetype = get_mimetype(file.path)
|
||||
stem, _ = split_path_stem_and_suffix(file.path)
|
||||
try:
|
||||
groups[stem].append(file)
|
||||
|
|
|
|||
|
|
@ -108,6 +108,10 @@ def _mimetype_suffix_map(path: Path, mimetype: str):
|
|||
return 'text/vtt'
|
||||
if suffix.endswith('.csv'):
|
||||
return 'text/csv'
|
||||
if suffix.endswith('.html') or suffix.endswith('.htm'):
|
||||
return 'text/html'
|
||||
if suffix.endswith('.stl'):
|
||||
return 'application/sta'
|
||||
return mimetype
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue