Optimize startup: skip series loading on every SeriesApp init
- SeriesApp now passes skip_load=True to SerieList - Prevents redundant data file loading on every startup - Series loaded once during setup via sync_series_from_data_files() - Removed obsolete _init_list_sync() and _init_list() methods - Updated documentation in ARCHITECTURE.md and README.md
This commit is contained in:
56
README.md
56
README.md
@@ -4,22 +4,22 @@ A web-based anime download manager with REST API, WebSocket real-time updates, a
|
||||
|
||||
## Features
|
||||
|
||||
- Web interface for managing anime library
|
||||
- REST API for programmatic access
|
||||
- WebSocket real-time progress updates
|
||||
- Download queue with priority management
|
||||
- Automatic library scanning for missing episodes
|
||||
- **NFO metadata management with TMDB integration**
|
||||
- **Automatic poster/fanart/logo downloads**
|
||||
- JWT-based authentication
|
||||
- SQLite database for persistence
|
||||
- Web interface for managing anime library
|
||||
- REST API for programmatic access
|
||||
- WebSocket real-time progress updates
|
||||
- Download queue with priority management
|
||||
- Automatic library scanning for missing episodes
|
||||
- **NFO metadata management with TMDB integration**
|
||||
- **Automatic poster/fanart/logo downloads**
|
||||
- JWT-based authentication
|
||||
- SQLite database for persistence
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Python 3.10+
|
||||
- Conda (recommended) or virtualenv
|
||||
- Python 3.10+
|
||||
- Conda (recommended) or virtualenv
|
||||
|
||||
### Installation
|
||||
|
||||
@@ -144,12 +144,34 @@ conda run -n AniWorld python -m pytest tests/integration/ -v
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Web Framework**: FastAPI 0.104.1
|
||||
- **Database**: SQLite + SQLAlchemy 2.0
|
||||
- **Auth**: JWT (python-jose) + passlib
|
||||
- **Validation**: Pydantic 2.5
|
||||
- **Logging**: structlog
|
||||
- **Testing**: pytest + pytest-asyncio
|
||||
- **Web Framework**: FastAPI 0.104.1
|
||||
- **Database**: SQLite + SQLAlchemy 2.0
|
||||
- **Auth**: JWT (python-jose) + passlib
|
||||
- **Validation**: Pydantic 2.5
|
||||
- **Logging**: structlog
|
||||
- **Testing**: pytest + pytest-asyncio
|
||||
|
||||
## Application Lifecycle
|
||||
|
||||
### Initialization
|
||||
|
||||
On first startup, the application performs a one-time sync of series from data files to the database:
|
||||
|
||||
1. FastAPI lifespan starts
|
||||
2. Database is initialized
|
||||
3. `sync_series_from_data_files()` reads all data files from the anime directory
|
||||
4. Series metadata is synced to the database
|
||||
5. `SeriesApp` loads series from database (not from files)
|
||||
|
||||
On subsequent startups, `SeriesApp` initializes with an empty series list (`skip_load=True`). Series are loaded from the database by the service layer as needed, avoiding redundant file system scans.
|
||||
|
||||
### Adding New Series
|
||||
|
||||
When adding a new series:
|
||||
|
||||
1. Series is added to the database via `AnimeService`
|
||||
2. Data file is created in the anime directory
|
||||
3. In-memory `SerieList` is updated via `load_series_from_list()`
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user