Allow refreshing single podcast

This commit is contained in:
Thomas Perl 2015-03-07 15:01:52 +01:00
parent bc8241e99a
commit 8caf02e713

View file

@ -137,6 +137,7 @@ class gPotherSide:
'coverart': self._get_cover(podcast), 'coverart': self._get_cover(podcast),
'updating': podcast._updating, 'updating': podcast._updating,
'section': podcast.section, 'section': podcast.section,
'url': podcast.url,
} }
def _get_podcasts_sorted(self): def _get_podcasts_sorted(self):
@ -305,13 +306,13 @@ class gPotherSide:
self.core.save() self.core.save()
@run_in_background_thread @run_in_background_thread
def check_for_episodes(self): def check_for_episodes(self, url=None):
if self._checking_for_new_episodes: if self._checking_for_new_episodes:
return return
self._checking_for_new_episodes = True self._checking_for_new_episodes = True
pyotherside.send('refreshing', True) pyotherside.send('refreshing', True)
podcasts = self._get_podcasts_sorted() podcasts = [podcast for podcast in self._get_podcasts_sorted() if url is None or podcast.url == url]
for index, podcast in enumerate(podcasts): for index, podcast in enumerate(podcasts):
pyotherside.send('refresh-progress', index, len(podcasts)) pyotherside.send('refresh-progress', index, len(podcasts))
pyotherside.send('updating-podcast', podcast.id) pyotherside.send('updating-podcast', podcast.id)