fix #516 - gpodder does not recognize new episodes as new and therefore does not download them

the heuristics to not mark episodes with older dates new was
tricked by a publishedDate in the future
This commit is contained in:
Eric Le Lay 2018-08-17 12:42:18 +02:00
parent 48ac787af9
commit 49d2d36496
1 changed files with 7 additions and 0 deletions

View File

@ -649,6 +649,7 @@ class PodcastChannel(PodcastModelObject):
]
MAX_FOLDERNAME_LENGTH = 60
SECONDS_PER_DAY = 24 * 60 * 60
SECONDS_PER_WEEK = 7 * 24 * 60 * 60
EpisodeClass = PodcastEpisode
@ -936,6 +937,12 @@ class PodcastChannel(PodcastModelObject):
# Get most recent published of all episodes
last_published = self.db.get_last_published(self) or 0
# fix for #516 an episode was marked published one month in the future (typo in month number)
# causing every new episode to be marked old
tomorrow = datetime.datetime.now().timestamp() + self.SECONDS_PER_DAY
if last_published > tomorrow:
logger.debug('Episode published in the future for podcast %s', self.title)
last_published = tomorrow
# Keep track of episode GUIDs currently seen in the feed
seen_guids = set()