Don't purge in-progress downloads (bug 1534)

This commit is contained in:
Thomas Perl 2012-01-06 13:27:09 +01:00
parent cd5db4be75
commit c0de335000
1 changed files with 4 additions and 3 deletions

View File

@ -1070,10 +1070,11 @@ class PodcastChannel(PodcastModelObject):
def remove_unreachable_episodes(self, existing, seen_guids, max_episodes):
# Remove "unreachable" episodes - episodes that have not been
# downloaded and that the feed does not list as downloadable anymore
# Keep episodes that are currently being downloaded, though (bug 1534)
if self.id is not None:
episodes_to_purge = (e for e in existing if \
e.state != gpodder.STATE_DOWNLOADED and \
e.guid not in seen_guids)
episodes_to_purge = (e for e in existing if
e.state != gpodder.STATE_DOWNLOADED and
e.guid not in seen_guids and not e.downloading)
for episode in episodes_to_purge:
logger.debug('Episode removed from feed: %s (%s)',