10b4e8cf20
Muestra contadores de ficheros por estado (caché, descargados, no encontrados, omitidos) tanto al finalizar normalmente como al interrumpir con Ctrl+C. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
859 B
Python
31 lines
859 B
Python
import logging
|
|
import sys
|
|
|
|
import config
|
|
from zxdb import database, organizer, filesystem, downloader
|
|
from zxdb.setup.__main__ import main as run_setup
|
|
from zxdb.setup.docker_manager import stop_container, CONTAINER_NAME
|
|
|
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
|
|
|
def main():
|
|
stats = {}
|
|
try:
|
|
if run_setup() != 0:
|
|
sys.exit(1)
|
|
|
|
elements = database.connect(query_index=3)
|
|
elements = organizer.process_elements(elements)
|
|
filesystem.print_elements(elements, mode=1)
|
|
filesystem.clear_destination_folder()
|
|
stats = downloader.get_files(elements)
|
|
filesystem.remove_empty_directories(config.DESTINATION_PATH)
|
|
finally:
|
|
filesystem.print_summary(stats)
|
|
stop_container(CONTAINER_NAME)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|