Skip to content

Commit

Permalink
adjusts code style
Browse files Browse the repository at this point in the history
  • Loading branch information
eug3nix committed Jan 29, 2022
1 parent 2b4362b commit 9b197c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lbry/schema/mime_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,18 @@ def guess_media_type(path):
try:
kind = filetype.guess(path)
if kind:
realext = f".{kind.extension}"
real_extension = f".{kind.extension}"

# override extension parsed from file...
if extension != realext:
if extension != real_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:
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
if not extension in synonyms_map.get(realext, []):
extension = realext
if extension not in synonyms_map.get(real_extension, []):
extension = real_extension

except OSError as error:
pass
Expand Down

0 comments on commit 9b197c7

Please sign in to comment.