Private GIT

Skip to content
Snippets Groups Projects
Commit 0b54742a authored by Alexandre Beloin's avatar Alexandre Beloin
Browse files

Merge pull request #1663 from abeloin/patch-pp_quality

PostProcess: Fix lower quality, bigger sized file overwriting current episode.
parents a74d6552 e4348a51
Branches
No related tags found
No related merge requests found
...@@ -838,6 +838,7 @@ class PostProcessor(object): ...@@ -838,6 +838,7 @@ class PostProcessor(object):
# retrieve/create the corresponding TVEpisode objects # retrieve/create the corresponding TVEpisode objects
ep_obj = self._get_ep_obj(show, season, episodes) ep_obj = self._get_ep_obj(show, season, episodes)
old_ep_status, old_ep_quality = common.Quality.splitCompositeStatus(ep_obj.status)
# get the quality of the episode we're processing # get the quality of the episode we're processing
if quality: if quality:
...@@ -867,6 +868,11 @@ class PostProcessor(object): ...@@ -867,6 +868,11 @@ class PostProcessor(object):
# if it's not priority then we don't want to replace smaller files in case it was a mistake # if it's not priority then we don't want to replace smaller files in case it was a mistake
if not priority_download: if not priority_download:
# Not a priority and the quality is lower than what we already have
if (new_ep_quality < old_ep_quality and new_ep_quality != common.Quality.UNKNOWN) and not existing_file_status == PostProcessor.DOESNT_EXIST:
self._log(u"File exists and new file quality is lower than existing, marking it unsafe to replace", logger.DEBUG)
return False
# if there's an existing file that we don't want to replace stop here # if there's an existing file that we don't want to replace stop here
if existing_file_status == PostProcessor.EXISTS_LARGER: if existing_file_status == PostProcessor.EXISTS_LARGER:
if self.is_proper: if self.is_proper:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment