create parent directory before saving cover image

This commit is contained in:
Rafael Moraes 2024-08-03 17:49:42 -03:00
parent 091ca3bf53
commit a35a3835aa

View File

@ -512,6 +512,7 @@ class Downloader:
@functools.lru_cache() @functools.lru_cache()
def save_cover(self, cover_path: Path, cover_url: str): def save_cover(self, cover_path: Path, cover_url: str):
cover_path.parent.mkdir(parents=True, exist_ok=True)
cover_path.write_bytes(self.get_url_response_bytes(cover_url)) cover_path.write_bytes(self.get_url_response_bytes(cover_url))
def cleanup_temp_path(self): def cleanup_temp_path(self):