pandora/pandora/archive/management/commands/continue_encoding.py
2016-02-20 15:15:01 +05:30

21 lines
489 B
Python

# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from django.core.management.base import BaseCommand
import app.monkey_patch
from ... import models
class Command(BaseCommand):
"""
"""
help = 'reinject files into encoding queue'
args = ''
def handle(self, **options):
for f in models.File.objects.filter(encoding=True):
if f.streams.all().count():
f.process_stream()
elif f.data:
f.extract_stream()