diff --git a/src/ffx/helper.py b/src/ffx/helper.py index b6828ce..c0d8af9 100644 --- a/src/ffx/helper.py +++ b/src/ffx/helper.py @@ -83,6 +83,8 @@ def filterFilename(fileName: str) -> str: fileName = str(fileName).replace('*', '') fileName = str(fileName).replace("'", '') fileName = str(fileName).replace("?", '#') + fileName = str(fileName).replace('♥', '') + fileName = str(fileName).replace('’', '') return fileName.strip() diff --git a/src/ffx/shifted_season_controller.py b/src/ffx/shifted_season_controller.py index a9c0fe1..b6e01e6 100644 --- a/src/ffx/shifted_season_controller.py +++ b/src/ffx/shifted_season_controller.py @@ -18,9 +18,16 @@ class ShiftedSeasonController(): self.Session = self.context['database']['session'] # convenience def checkShiftedSeason(self, showId: int, shiftedSeasonObj: dict, shiftedSeasonId: int = 0): + """ + Check if for a particula season + + shiftedSeasonId + """ + try: s = self.Session() + originalSeason = shiftedSeasonObj['original_season'] firstEpisode = int(shiftedSeasonObj['first_episode']) lastEpisode = int(shiftedSeasonObj['last_episode']) @@ -31,11 +38,14 @@ class ShiftedSeasonController(): siblingShiftedSeason: ShiftedSeason for siblingShiftedSeason in q.all(): + siblingOriginalSeason = siblingShiftedSeason.getOriginalSeason siblingFirstEpisode = siblingShiftedSeason.getFirstEpisode() siblingLastEpisode = siblingShiftedSeason.getLastEpisode() - if (lastEpisode >= siblingFirstEpisode + if (originalSeason == siblingOriginalSeason + and lastEpisode >= siblingFirstEpisode and siblingLastEpisode >= firstEpisode): + return False return True