mirror of
https://github.com/glomatico/votify.git
synced 2026-10-22 15:52:25 +02:00
update cleanup_temp_path
This commit is contained in:
@@ -572,10 +572,10 @@ class Downloader:
|
||||
playlist_track,
|
||||
)
|
||||
|
||||
def _cleanup_temp_path(self):
|
||||
def cleanup_temp_path(self):
|
||||
if self.temp_path.exists() and not self.skip_cleanup:
|
||||
logger.debug(f'Cleaning up "{self.temp_path}"')
|
||||
self.cleanup_temp_path()
|
||||
shutil.rmtree(self.temp_path)
|
||||
|
||||
@staticmethod
|
||||
@functools.lru_cache()
|
||||
@@ -593,6 +593,3 @@ class Downloader:
|
||||
if cover_url is not None:
|
||||
cover_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
cover_path.write_bytes(self.get_response_bytes(cover_url))
|
||||
|
||||
def cleanup_temp_path(self):
|
||||
shutil.rmtree(self.temp_path)
|
||||
|
||||
@@ -59,7 +59,7 @@ class DownloaderEpisode(DownloaderAudio):
|
||||
try:
|
||||
self._download(*args, **kwargs)
|
||||
finally:
|
||||
self.downloader._cleanup_temp_path()
|
||||
self.downloader.cleanup_temp_path()
|
||||
|
||||
def _download(
|
||||
self,
|
||||
|
||||
@@ -30,7 +30,7 @@ class DownloaderEpisodeVideo(DownloaderVideo):
|
||||
try:
|
||||
self._download(*args, **kwargs)
|
||||
finally:
|
||||
self.downloader._cleanup_temp_path()
|
||||
self.downloader.cleanup_temp_path()
|
||||
|
||||
def _download(
|
||||
self,
|
||||
|
||||
@@ -94,7 +94,7 @@ class DownloaderMusicVideo(DownloaderVideo):
|
||||
finally:
|
||||
if self.downloader.temp_path.exists():
|
||||
logger.debug(f'Cleaning up "{self.downloader.temp_path}"')
|
||||
self.downloader.cleanup_temp_path()
|
||||
self.downloader.cleanup_temp_path_ab()
|
||||
|
||||
def _download(
|
||||
self,
|
||||
|
||||
@@ -136,7 +136,7 @@ class DownloaderSong(DownloaderAudio):
|
||||
try:
|
||||
self._download(*args, **kwargs)
|
||||
finally:
|
||||
self.downloader._cleanup_temp_path()
|
||||
self.downloader.cleanup_temp_path()
|
||||
|
||||
def _download(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user