fallback less frequently to text/gemini mime

This commit is contained in:
Lionel Dricot 2022-03-06 18:11:59 +01:00
parent f322c8d73c
commit 907fc70b5d
1 changed files with 5 additions and 2 deletions

View File

@ -1265,8 +1265,11 @@ class GeminiItem():
if not mime and not _HAS_MAGIC :
print("Cannot guess the mime type of the file. Install Python-magic")
if mime.startswith("text") and mime not in _FORMAT_RENDERERS:
#by default, we consider its gemini except for html
mime = "text/gemini"
if mime2 and mime2 in _FORMAT_RENDERERS:
mime = mime2
else:
#by default, we consider its gemini except for html
mime = "text/gemini"
self.mime = mime
return self.mime