Add complete AnimeLibrarian implementation
- Full application structure with core, API clients, and UI modules - Directory compatibility checker with comprehensive validation - TheTVDB API integration for metadata and standardized naming - trace.moe API integration for episode verification - File renamer with TVDB format compliance - Interactive CLI interface with detailed reporting - Configuration system with validation and defaults - Comprehensive error handling and logging - Support for backup and dry-run operations - Project developed by the Légion de Muyue 💘 Generated with Crush Assisted-by: GLM-4.6 via Crush <crush@charm.land>
This commit is contained in:
69
main.py
Normal file
69
main.py
Normal file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
AnimeLibrarian - Outil d'organisation et de vérification de collections d'anime
|
||||
Point d'entrée principal de l'application
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
# Ajout du répertoire courant au path pour importer les modules locaux
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
from src.core import AnimeLibrarianCore
|
||||
from src.ui import AnimeLibrarianUI
|
||||
from src.utils import setup_logging, load_config
|
||||
|
||||
|
||||
def main():
|
||||
"""Point d'entrée principal de l'application"""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="AnimeLibrarian - Outil d'organisation et de vérification de collections d'anime"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--config", "-c",
|
||||
type=str,
|
||||
help="Chemin vers le fichier de configuration",
|
||||
default="config.json"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--verbose", "-v",
|
||||
action="store_true",
|
||||
help="Active le mode verbeux"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--directory", "-d",
|
||||
type=str,
|
||||
help="Répertoire de base à analyser (contournement de la sélection interactive)"
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Configuration du logging
|
||||
setup_logging(verbose=args.verbose)
|
||||
|
||||
# Chargement de la configuration
|
||||
config = load_config(args.config)
|
||||
|
||||
# Initialisation du cœur de l'application
|
||||
core = AnimeLibrarianCore(config)
|
||||
|
||||
# Initialisation de l'interface utilisateur
|
||||
ui = AnimeLibrarianUI(core)
|
||||
|
||||
# Lancement de l'interface interactive
|
||||
ui.run(preselected_directory=args.directory)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print("\nOpération annulée par l'utilisateur.")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f"Erreur: {e}")
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user