diff --git a/CHANGES.md b/CHANGES.md index 8f649ca6..44f6fade 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 3.27.10 (2023-03-05 00:20:00 UTC) +### 3.27.11 (2023-03-06 23:40:00 UTC) + +* Fix "Change File Date" not using timestamp of episode if available + + +### 3.27.10 (2023-03-05 00:20:00 UTC) * Add UHD Bluray * Change an error text for Cheetah module availability diff --git a/sickgear/tv.py b/sickgear/tv.py index 3dce3dd7..8e97e111 100644 --- a/sickgear/tv.py +++ b/sickgear/tv.py @@ -5276,14 +5276,20 @@ class TVEpisode(TVEpisodeBase): Note: Also called from postProcessor """ - has_timestamp = isinstance(self._timestamp, int) and 1 < self._timestamp + has_timestamp = isinstance(self._timestamp, int) and 0 != self._timestamp if not has_timestamp and (not isinstance(self._airdate, datetime.date) or 1 == self._airdate.year): logger.log('%s: Did not change modify date of %s because episode date is never aired or invalid' % (self._show_obj.tvid_prodid, ek.ek(os.path.basename, self.location)), logger.DEBUG) return aired_dt = None - if not has_timestamp: + if has_timestamp: + try: + aired_dt = SGDatetime.from_timestamp(self._timestamp) + except (BaseException, Exception): + aired_dt = None + + if not aired_dt: if isinstance(self._airtime, datetime.time): airtime = self._airtime else: