mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Fix for files being deleted from show folder during post-processing runs
This commit is contained in:
parent
acf4462a94
commit
27189d0406
@ -224,6 +224,7 @@ class PostProcessor(object):
|
|||||||
self._log(u'Cannot change permissions of ' + cur_file, logger.WARNING)
|
self._log(u'Cannot change permissions of ' + cur_file, logger.WARNING)
|
||||||
|
|
||||||
ek.ek(os.remove, cur_file)
|
ek.ek(os.remove, cur_file)
|
||||||
|
|
||||||
# do the library update for synoindex
|
# do the library update for synoindex
|
||||||
notifiers.synoindex_notifier.deleteFile(cur_file)
|
notifiers.synoindex_notifier.deleteFile(cur_file)
|
||||||
|
|
||||||
@ -855,6 +856,18 @@ class PostProcessor(object):
|
|||||||
u"This download is marked a priority download so I'm going to replace an existing file if I find one",
|
u"This download is marked a priority download so I'm going to replace an existing file if I find one",
|
||||||
logger.DEBUG)
|
logger.DEBUG)
|
||||||
|
|
||||||
|
# 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")
|
||||||
|
|
||||||
# set the status of the episodes
|
# set the status of the episodes
|
||||||
# for curEp in [ep_obj] + ep_obj.relatedEps:
|
# for curEp in [ep_obj] + ep_obj.relatedEps:
|
||||||
# curEp.status = common.Quality.compositeStatus(common.SNATCHED, new_ep_quality)
|
# curEp.status = common.Quality.compositeStatus(common.SNATCHED, new_ep_quality)
|
||||||
@ -966,17 +979,6 @@ class PostProcessor(object):
|
|||||||
except (OSError, IOError):
|
except (OSError, IOError):
|
||||||
raise exceptions.PostProcessingFailed("Unable to move the files to their new home")
|
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
|
# download subtitles
|
||||||
if sickbeard.USE_SUBTITLES and ep_obj.show.subtitles:
|
if sickbeard.USE_SUBTITLES and ep_obj.show.subtitles:
|
||||||
for cur_ep in [ep_obj] + ep_obj.relatedEps:
|
for cur_ep in [ep_obj] + ep_obj.relatedEps:
|
||||||
|
Loading…
Reference in New Issue
Block a user