fix IndexError when merging episodes of single podcast
authorStefan Kögl <stefan@skoegl.net>
Mon, 20 May 2013 12:45:19 +0000 (20 14:45 +0200)
committerStefan Kögl <stefan@skoegl.net>
Mon, 20 May 2013 12:45:19 +0000 (20 14:45 +0200)
mygpo/admin/tasks.py
mygpo/maintenance/merge.py

index 2253d5f..0e99876 100644 (file)
@@ -21,8 +21,8 @@ def merge_podcasts(podcast_ids, num_groups):
     actions = Counter()
 
     pm = PodcastMerger(podcasts, actions, num_groups)
-    pm.merge()
+    podcast = pm.merge()
 
     logger.info('merging result: %s', actions)
 
-    return actions, podcasts[0]
+    return actions, podcast
index ae960d4..b7bfd42 100644 (file)
@@ -47,6 +47,8 @@ class PodcastMerger(object):
             delete_podcast(podcast2)
             self.actions['merge-podcast'] += 1
 
+        return podcast1
+
     def merge_episodes(self):
         """ Merges the episodes according to the groups """