mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 00:43:37 +00:00
Delete files after it performs copy/movie/link instead
This commit is contained in:
parent
dd23bf39e9
commit
872dd2b9fc
1 changed files with 11 additions and 11 deletions
|
@ -859,17 +859,6 @@ class PostProcessor(object):
|
|||
# for curEp in [ep_obj] + ep_obj.relatedEps:
|
||||
# curEp.status = common.Quality.compositeStatus(common.SNATCHED, new_ep_quality)
|
||||
|
||||
# delete the existing file (and company)
|
||||
for cur_ep in [ep_obj] + ep_obj.relatedEps:
|
||||
try:
|
||||
self._delete(cur_ep.location, associated_files=True)
|
||||
# clean up any left over folders
|
||||
if cur_ep.location:
|
||||
helpers.delete_empty_folders(ek.ek(os.path.dirname, cur_ep.location),
|
||||
keep_dir=ep_obj.show._location)
|
||||
except (OSError, IOError):
|
||||
raise exceptions.PostProcessingFailed("Unable to delete the existing files")
|
||||
|
||||
# if the show directory doesn't exist then make it if allowed
|
||||
if not ek.ek(os.path.isdir, ep_obj.show._location) and sickbeard.CREATE_MISSING_SHOW_DIRS:
|
||||
self._log(u"Show directory doesn't exist, creating it", logger.DEBUG)
|
||||
|
@ -977,6 +966,17 @@ class PostProcessor(object):
|
|||
except (OSError, IOError):
|
||||
raise exceptions.PostProcessingFailed("Unable to move the files to their new home")
|
||||
|
||||
# delete the existing file (and company)
|
||||
for cur_ep in [ep_obj] + ep_obj.relatedEps:
|
||||
try:
|
||||
self._delete(cur_ep.location, associated_files=True)
|
||||
# clean up any left over folders
|
||||
if cur_ep.location:
|
||||
helpers.delete_empty_folders(ek.ek(os.path.dirname, cur_ep.location),
|
||||
keep_dir=ep_obj.show._location)
|
||||
except (OSError, IOError):
|
||||
raise exceptions.PostProcessingFailed("Unable to delete the existing files")
|
||||
|
||||
# download subtitles
|
||||
if sickbeard.USE_SUBTITLES and ep_obj.show.subtitles:
|
||||
for cur_ep in [ep_obj] + ep_obj.relatedEps:
|
||||
|
|
Loading…
Reference in a new issue