Commit 00d41545 authored by fred's avatar fred

fix parsing of podcasts stats

parent bf81e85b
......@@ -11,5 +11,5 @@ from emissions.models import SoundFile
class Command(BaseCommand):
def handle(self, *args, **kwargs):
resp = requests.get(urllib.parse.urljoin(settings.WEBSITE_BASE_URL, '__webstats/downloads.json'))
for soundfile_id, download_count in resp.json():
for soundfile_id, download_count in resp.json().items():
SoundFile.objects.filter(id=soundfile_id).update(download_count=download_count)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment