import logging

from django.core.management.base import BaseCommand

from gallery.utils import create_thumbs, get_folder_list


logger = logging.getLogger(__name__)

class Command(BaseCommand):
    def handle(self, *args, **options):
        for folder in get_folder_list():
            logger.info(f"Folder '{folder}' in process.")
            create_thumbs(folder)

        logger.info(f"Command 'create thumbs' ended.")
