From baf6c9bd785d906db9692ba089c92f344beb31b9 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Wed, 27 Aug 2014 22:19:18 +0100 Subject: [PATCH] Archive mixes now works on all mixes --- spa/management/commands/archive_mixes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/management/commands/archive_mixes.py b/spa/management/commands/archive_mixes.py index 0246b7a..1b803ed 100755 --- a/spa/management/commands/archive_mixes.py +++ b/spa/management/commands/archive_mixes.py @@ -18,11 +18,11 @@ class Command(NoArgsCommand): driver = cls(settings.AZURE_ACCOUNT_NAME, settings.AZURE_ACCOUNT_KEY) container = driver.get_container(container_name=settings.AZURE_CONTAINER) + #.filter(upload_date__lte=datetime.today() - timedelta(days=180)) \ mixes = Mix.objects \ - .filter(upload_date__lte=datetime.today() - timedelta(days=180)) \ .exclude(archive_path__isnull=False) \ .annotate(num_plays=Count('activity_plays')) \ - .order_by('num_plays')[:10] + .order_by('num_plays') for mix in mixes: if os.path.isfile(mix.get_absolute_path()): print "Uploading file for: %s" % mix.slug