Merge pull request #458 from kevinoid/fix-cover-tmp-fs

Fix cover file saving with /tmp on different FS
This commit is contained in:
JoeLametta
2020-01-28 17:31:09 +01:00
committed by GitHub

View File

@@ -25,6 +25,7 @@ Common functionality and class for all programs using whipper.
import musicbrainzngs
import re
import os
import shutil
import time
from tempfile import NamedTemporaryFile
@@ -495,7 +496,7 @@ class Program:
with NamedTemporaryFile(suffix='.cover.jpg', delete=False) as f:
f.write(data)
os.chmod(f.name, 0o644)
os.replace(f.name, cover_art_path)
shutil.move(f.name, cover_art_path)
logger.debug('cover art fetched at: %r', cover_art_path)
return cover_art_path
return