gpodder.model: Do not add files without filename

This commit is contained in:
Thomas Perl 2014-01-30 08:29:38 +01:00
parent fa2104de1f
commit 7ad8417989

View file

@ -818,7 +818,11 @@ class PodcastChannel(PodcastModelObject):
for episode in self.get_episodes(gpodder.STATE_DOWNLOADED):
if episode.was_downloaded():
filename = episode.local_filename(create=False)
if filename is not None and not os.path.exists(filename):
if filename is None:
# No filename has been determined for this episode
continue
if not os.path.exists(filename):
# File has been deleted by the user - simulate a
# delete event (also marks the episode as deleted)
logger.debug('Episode deleted: %s', filename)