adjusts code style
This commit is contained in:
parent
96d1745232
commit
e90fb9a28f
1 changed files with 6 additions and 6 deletions
|
@ -187,18 +187,18 @@ def guess_media_type(path):
|
||||||
try:
|
try:
|
||||||
kind = filetype.guess(path)
|
kind = filetype.guess(path)
|
||||||
if kind:
|
if kind:
|
||||||
realext = f".{kind.extension}"
|
real_extension = f".{kind.extension}"
|
||||||
|
|
||||||
# override extension parsed from file...
|
# override extension parsed from file...
|
||||||
if extension != realext:
|
if extension != real_extension:
|
||||||
if extension:
|
if extension:
|
||||||
log.warning(f"file extension does not match it's contents {path}, identified as {realext}")
|
log.warning(f"file extension does not match it's contents: {path}, identified as {real_extension}")
|
||||||
else:
|
else:
|
||||||
log.debug(f"file {path} does not have extension, identified by contents as {realext}")
|
log.debug(f"file {path} does not have extension, identified by it's contents as {real_extension}")
|
||||||
|
|
||||||
# don't do anything if extension is in synonyms
|
# don't do anything if extension is in synonyms
|
||||||
if not extension in synonyms_map.get(realext, []):
|
if extension not in synonyms_map.get(real_extension, []):
|
||||||
extension = realext
|
extension = real_extension
|
||||||
|
|
||||||
except OSError as error:
|
except OSError as error:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue