diff --git a/CHANGES.md b/CHANGES.md index bc8e989a..81e9d159 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,11 @@ * Change codebase cleanups +### 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 diff --git a/sickgear/tv.py b/sickgear/tv.py index 73143391..8a6c274f 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, 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: