from optparse import make_option

from django.core.management.base import BaseCommand

from mygpo.podcasts.models import Podcast
from mygpo.utils import progress
from mygpo.directory.tasks import update_podcast_subscribers


class Command(BaseCommand):
    """ For each podcast a task is scheduled to update its subscriber count """

    def add_arguments(self, parser):
        parser.add_argument(
            "--silent",
            action="store_true",
            dest="silent",
            default=False,
            help="Don't show any output",
        ),

    def handle(self, *args, **options):

        silent = options.get("silent")

        podcasts = Podcast.objects.all()
        total = podcasts.count_fast()

        for n, podcast in enumerate(podcasts):
            update_podcast_subscribers.delay(podcast.get_id())

            if not silent:
                progress(n, total)

mygpo/directory/management/commands/update-toplist.py
from optparse import make_option

from django.core.management.base import BaseCommand

from mygpo.podcasts.models import Podcast
from mygpo.utils import progress
from mygpo.directory.tasks import update_podcast_subscribers


class Command(BaseCommand):
    """ For each podcast a task is scheduled to update its subscriber count """

    def add_arguments(self, parser):
        parser.add_argument(
            "--silent",
            action="store_true",
            dest="silent",
            default=False,
            help="Don't show any output",
        ),

    def handle(self, *args, **options):

        silent = options.get("silent")

        podcasts = Podcast.objects.all()
        total = podcasts.count()

        for n, podcast in enumerate(podcasts):
            update_podcast_subscribers.delay(podcast.get_id())

            if not silent:
                progress(n, total)

mygpo/directory/management/commands/update-toplist.py
diff --git a/mygpo/directory/management/commands/update-toplist.py b/mygpo/directory/management/commands/update-toplist.py
index 08e97d73b..d1441d521 100644
--- a/mygpo/directory/management/commands/update-toplist.py
+++ b/mygpo/directory/management/commands/update-toplist.py
@@ -24,7 +24,7 @@ def handle(self, *args, **options):
         silent = options.get("silent")
 
         podcasts = Podcast.objects.all()
-        total = podcasts.count_fast()
+        total = podcasts.count()
 
         for n, podcast in enumerate(podcasts):
             update_podcast_subscribers.delay(podcast.get_id())

Error when trying to run manage.py update-toplist
```
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    execute_from_command_line(sys.argv)
  File "/home/mike/mygpo/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/mike/mygpo/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/mike/mygpo/venv/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/mike/mygpo/venv/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/home/mike/mygpo/mygpo/directory/management/commands/update-toplist.py", line 27, in handle
    total = podcasts.count_fast()
AttributeError: 'PodcastQuerySet' object has no attribute 'count_fast'
```
