Refresh podcasts in display order
This commit is contained in:
parent
a621f93311
commit
fdaa87df4c
1 changed files with 7 additions and 4 deletions
11
main.py
11
main.py
|
@ -118,10 +118,13 @@ class gPotherSide:
|
||||||
'section': podcast.section,
|
'section': podcast.section,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def _get_podcasts_sorted(self):
|
||||||
|
return sorted(self.core.model.get_podcasts(),
|
||||||
|
key=lambda podcast: (podcast.section, podcast.title))
|
||||||
|
|
||||||
def load_podcasts(self):
|
def load_podcasts(self):
|
||||||
podcasts = self.core.model.get_podcasts()
|
podcasts = self._get_podcasts_sorted()
|
||||||
return [self.convert_podcast(podcast) for podcast in sorted(podcasts,
|
return [self.convert_podcast(podcast) for podcast in podcasts]
|
||||||
key=lambda podcast: (podcast.section, podcast.title))]
|
|
||||||
|
|
||||||
def convert_episode(self, episode):
|
def convert_episode(self, episode):
|
||||||
return {
|
return {
|
||||||
|
@ -242,7 +245,7 @@ class gPotherSide:
|
||||||
|
|
||||||
self._checking_for_new_episodes = True
|
self._checking_for_new_episodes = True
|
||||||
pyotherside.send('refreshing', True)
|
pyotherside.send('refreshing', True)
|
||||||
podcasts = self.core.model.get_podcasts()
|
podcasts = self._get_podcasts_sorted()
|
||||||
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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue