Merge pull request #492 from JackDandy/feature/FixSeasonPackPP

Fix post processing season pack folders.
This commit is contained in:
JackDandy 2015-08-22 20:06:55 +01:00
commit 80527a2f43
2 changed files with 14 additions and 14 deletions

View file

@ -24,6 +24,7 @@
* Update Tornado Web Server 4.2 to 4.3.dev1 (1b6157d) * Update Tornado Web Server 4.2 to 4.3.dev1 (1b6157d)
* Update change to suppress reporting of Tornado exception error 1 to updated package (ref:hacks.txt) * Update change to suppress reporting of Tornado exception error 1 to updated package (ref:hacks.txt)
* Update fix for API response header for JSON content type and the return of JSONP data to updated package (ref:hacks.txt) * Update fix for API response header for JSON content type and the return of JSONP data to updated package (ref:hacks.txt)
* Fix post processing season pack folders
### 0.10.0 (2015-08-06 11:05:00 UTC) ### 0.10.0 (2015-08-06 11:05:00 UTC)

View file

@ -434,10 +434,6 @@ class ProcessTVShow(object):
try_scene_exceptions=True, try_scene_exceptions=True,
convert=True).parse( convert=True).parse(
dir_name, cache_result=False) dir_name, cache_result=False)
# check we parsed id, ep and season
if not (0 < len(parse_result.episode_numbers) and isinstance(parse_result.show.indexerid, int)
and isinstance(parse_result.season_number, int)):
return False
except (InvalidNameException, InvalidShowException): except (InvalidNameException, InvalidShowException):
# If the filename doesn't parse, then return false as last # If the filename doesn't parse, then return false as last
# resort. We can assume that unparseable filenames are not # resort. We can assume that unparseable filenames are not
@ -448,7 +444,7 @@ class ProcessTVShow(object):
parse_result.show.name)[self.any_vid_processed] parse_result.show.name)[self.any_vid_processed]
ep_detail_sql = '' ep_detail_sql = ''
if parse_result.show.indexerid and parse_result.episode_numbers and parse_result.season_number: if parse_result.show.indexerid and 0 < len(parse_result.episode_numbers) and parse_result.season_number:
ep_detail_sql = " and tv_episodes.showid='%s' and tv_episodes.season='%s' and tv_episodes.episode='%s'"\ ep_detail_sql = " and tv_episodes.showid='%s' and tv_episodes.season='%s' and tv_episodes.episode='%s'"\
% (str(parse_result.show.indexerid), % (str(parse_result.show.indexerid),
str(parse_result.season_number), str(parse_result.season_number),
@ -460,9 +456,10 @@ class ProcessTVShow(object):
if sql_result: if sql_result:
self._log_helper(u'Found a release directory%s that has already been processed,<br />.. skipping: %s' self._log_helper(u'Found a release directory%s that has already been processed,<br />.. skipping: %s'
% (showlink, dir_name)) % (showlink, dir_name))
reset_status(parse_result.show.indexerid, if ep_detail_sql:
parse_result.season_number, reset_status(parse_result.show.indexerid,
parse_result.episode_numbers[0]) parse_result.season_number,
parse_result.episode_numbers[0])
return True return True
else: else:
@ -474,9 +471,10 @@ class ProcessTVShow(object):
if sql_result: if sql_result:
self._log_helper(u'Found a video, but that release%s was already processed,<br />.. skipping: %s' self._log_helper(u'Found a video, but that release%s was already processed,<br />.. skipping: %s'
% (showlink, videofile)) % (showlink, videofile))
reset_status(parse_result.show.indexerid, if ep_detail_sql:
parse_result.season_number, reset_status(parse_result.show.indexerid,
parse_result.episode_numbers[0]) parse_result.season_number,
parse_result.episode_numbers[0])
return True return True
# Needed if we have downloaded the same episode @ different quality # Needed if we have downloaded the same episode @ different quality
@ -491,9 +489,10 @@ class ProcessTVShow(object):
if sql_result: if sql_result:
self._log_helper(u'Found a video, but the episode%s is already processed,<br />.. skipping: %s' self._log_helper(u'Found a video, but the episode%s is already processed,<br />.. skipping: %s'
% (showlink, videofile)) % (showlink, videofile))
reset_status(parse_result.show.indexerid, if ep_detail_sql:
parse_result.season_number, reset_status(parse_result.show.indexerid,
parse_result.episode_numbers[0]) parse_result.season_number,
parse_result.episode_numbers[0])
return True return True
return False return False