2021-09-02 20:21:22 +02:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
2024-11-01 11:44:17 +01:00
|
|
|
from tvorba.models import Cislo
|
2021-09-02 20:21:22 +02:00
|
|
|
|
|
|
|
from subprocess import CalledProcessError
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
def handle(self, *args, **options):
|
|
|
|
for c in Cislo.objects.all():
|
|
|
|
try:
|
|
|
|
c.vygeneruj_nahled()
|
|
|
|
except CalledProcessError:
|
|
|
|
logger.warning(f"Číslo {c} nezvládlo vygenerovat náhled titulky!")
|
|
|
|
pass
|
|
|
|
|