Skip to content

Commit

Permalink
fix variable re-use
Browse files Browse the repository at this point in the history
  • Loading branch information
Winterbird committed Aug 31, 2023
1 parent b6f37bc commit 551b84b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions adbb/jellyfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ def write_nfo(obj, nfo_path, fetch_fanart=True, dry_run=False):
os.rename(tmpart, os.path.join(art_dir, fname))
if not all_arts['poster']:
fname = 'poster.jpg'
tmpfile = os.path.join(art_dir, f'.{fname}.tmp')
tmpart = os.path.join(art_dir, f'.{fname}.tmp')
try:
with open(tmpfile, 'wb') as f:
with open(tmpart, 'wb') as f:
adbb.download_image(f, anime)
os.rename(tmpfile, os.path.join(art_dir, fname))
os.rename(tmpart, os.path.join(art_dir, fname))
except urllib.error.HTTPError as e:
adbb.log.error(f'Failed to download anidb image for {anime}: {e}')
os.remove(tmpfile)
os.remove(tmpart)

os.rename(tmpfile, nfo_path)

Expand Down

0 comments on commit 551b84b

Please sign in to comment.