From 0af573bb1da05fcacc5fe25fb408ef229aab7af6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sun, 14 Feb 2016 17:07:47 +0100 Subject: [PATCH] Fix calculation of episode_count during podcast updates --- mygpo/data/feeddownloader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mygpo/data/feeddownloader.py b/mygpo/data/feeddownloader.py index 4ba3639c..cbd8dd9b 100755 --- a/mygpo/data/feeddownloader.py +++ b/mygpo/data/feeddownloader.py @@ -104,6 +104,9 @@ def update_podcast(podcast_url): assert parsed, 'fetch_feed must return something' p = Podcast.objects.get_or_create_for_url(podcast_url) episodes = _update_episodes(p, parsed.get('episodes', [])) + p.refresh_from_db() + p.episode_count = Episode.objects.filter(podcast=p).count() + p.save() max_episode_order = _order_episodes(p) _update_podcast(p, parsed, episodes, max_episode_order) return p -- 2.11.4.GIT