Skip to content

Commit

Permalink
Fix handling a cover without content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
kannibalox committed Feb 21, 2023
1 parent 366b7c1 commit dba175d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ptpapi/scripts/ptp_origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ def write_origin(t, args):
) as exc:
logger.error("Could not fetch cover URL %s: %s", m.group(0), exc)
return
if "Content-Type" in resp.headers and resp.headers[
if "Content-Type" not in resp.headers:
logger.warning("Cover did not return an content-type, cannot save")
a if resp.headers[
"Content-Type"
].startswith("image"):
with path.open("wb") as fh:
Expand Down

0 comments on commit dba175d

Please sign in to comment.