Commit Graph

17 Commits

Author SHA1 Message Date
fc8cdc538d fix(docker): add missing Python deps, fix VPN routing and healthcheck
- Add missing packages to requirements.txt: requests, beautifulsoup4,
  fake-useragent, yt-dlp, urllib3
- Fix entrypoint.sh: replace grep -oP (GNU) with awk (BusyBox compat)
- Fix entrypoint.sh: add policy routing so LAN clients get responses
  via eth0 instead of through the WireGuard tunnel
- Change healthcheck from ping to curl (VPN provider blocks ICMP)
- Add start_period and increase retries for healthcheck
- Change external port mapping to 2000:8000
- Add podman-compose.prod.yml and push.sh to version control
2026-02-24 19:21:53 +01:00
0265ae2a70 feat: cron-based scheduler with auto-download after rescan
- Replace asyncio sleep loop with APScheduler AsyncIOScheduler + CronTrigger
- Add schedule_time (HH:MM), schedule_days (days of week), auto_download_after_rescan fields to SchedulerConfig
- Add _auto_download_missing() to queue missing episodes after rescan
- Reload config live via reload_config(SchedulerConfig) without restart
- Update GET/POST /api/scheduler/config to return {success, config, status} envelope
- Add day-of-week pill toggles to Settings -> Scheduler section in UI
- Update JS loadSchedulerConfig / saveSchedulerConfig for new API shape
- Add 29 unit tests for SchedulerConfig model, 18 unit tests for SchedulerService
- Rewrite 23 endpoint tests and 36 integration tests for APScheduler behaviour
- Coverage: 96% api/scheduler, 95% scheduler_service, 90% total (>= 80% threshold)
- Update docs: API.md, CONFIGURATION.md, features.md, CHANGELOG.md
2026-02-21 08:56:17 +01:00
4895e487c0 feat: Add NFO metadata infrastructure (Task 3 - partial)
- Created TMDB API client with async requests, caching, and retry logic
- Implemented NFO XML generator for Kodi/XBMC format
- Created image downloader for poster/logo/fanart with validation
- Added NFO service to orchestrate metadata creation
- Added NFO-related configuration settings
- Updated requirements.txt with aiohttp, lxml, pillow
- Created unit tests (need refinement due to implementation mismatch)

Components created:
- src/core/services/tmdb_client.py (270 lines)
- src/core/services/nfo_service.py (390 lines)
- src/core/utils/nfo_generator.py (180 lines)
- src/core/utils/image_downloader.py (296 lines)
- tests/unit/test_tmdb_client.py
- tests/unit/test_nfo_generator.py
- tests/unit/test_image_downloader.py

Note: Tests need to be updated to match actual implementation APIs.
Dependencies installed: aiohttp, lxml, pillow
2026-01-11 20:33:33 +01:00
ee317b29f1 Remove migration code and alembic dependency 2025-12-13 09:02:26 +01:00
1637835fe6 Task 11: Implement Deployment and Configuration
- Add production.py with security hardening and performance optimizations
  - Required environment variables for security (JWT, passwords, database)
  - Database connection pooling for PostgreSQL/MySQL
  - Security configurations and allowed hosts
  - Production logging and rotation settings
  - API rate limiting and performance tuning

- Add development.py with relaxed settings for local development
  - Defaults for development (SQLite, debug logging, auto-reload)
  - Higher rate limits and longer session timeouts
  - Dev credentials for easy local setup
  - Development database defaults

- Add environment configuration loader (__init__.py)
  - Automatic environment detection
  - Factory functions for lazy loading settings
  - Proper environment validation

- Add startup scripts (start.sh)
  - Bash script for starting application in any environment
  - Conda environment validation
  - Automatic directory creation
  - Environment file generation
  - Database initialization
  - Development vs production startup modes

- Add setup script (setup.py)
  - Python setup automation for environment initialization
  - Dependency installation
  - Environment file generation
  - Database initialization
  - Comprehensive validation and error handling

- Update requirements.txt with psutil dependency

All configurations follow project coding standards and include comprehensive
documentation, type hints, and error handling.
2025-10-22 10:28:37 +02:00
ff0d865b7c feat: Implement SQLAlchemy database layer with comprehensive models
Implemented a complete database layer for persistent storage of anime series,
episodes, download queue, and user sessions using SQLAlchemy ORM.

Features:
- 4 SQLAlchemy models: AnimeSeries, Episode, DownloadQueueItem, UserSession
- Automatic timestamp tracking via TimestampMixin
- Foreign key relationships with cascade deletes
- Async and sync database session support
- FastAPI dependency injection integration
- SQLite optimizations (WAL mode, foreign keys)
- Enum types for status and priority fields

Models:
- AnimeSeries: Series metadata with one-to-many relationships
- Episode: Individual episodes linked to series
- DownloadQueueItem: Queue persistence with progress tracking
- UserSession: JWT session storage with expiry and revocation

Database Management:
- Async engine creation with aiosqlite
- Session factory with proper lifecycle
- Connection pooling configuration
- Automatic table creation on initialization

Testing:
- 19 comprehensive unit tests (all passing)
- In-memory SQLite for test isolation
- Relationship and constraint validation
- Query operation testing

Documentation:
- Comprehensive database section in infrastructure.md
- Database package README with examples
- Implementation summary document
- Usage guides and troubleshooting

Dependencies:
- Added: sqlalchemy>=2.0.35 (Python 3.13 compatible)
- Added: alembic==1.13.0 (for future migrations)
- Added: aiosqlite>=0.19.0 (async SQLite driver)

Files:
- src/server/database/__init__.py (package exports)
- src/server/database/base.py (base classes and mixins)
- src/server/database/models.py (ORM models, ~435 lines)
- src/server/database/connection.py (connection management)
- src/server/database/migrations.py (migration placeholder)
- src/server/database/README.md (package documentation)
- tests/unit/test_database_models.py (19 test cases)
- DATABASE_IMPLEMENTATION_SUMMARY.md (implementation summary)

Closes #9 Database Layer implementation task
2025-10-17 20:46:21 +02:00
028d91283e feat: implement download queue service with persistence, priority, and retry logic
- Added comprehensive download queue service (download_service.py)
  - Priority-based queue management (HIGH, NORMAL, LOW)
  - Concurrent download processing with configurable limits
  - Automatic queue persistence to JSON file
  - Retry logic for failed downloads with max retry limits
  - Real-time progress tracking and WebSocket broadcasting
  - Queue operations: add, remove, reorder, pause, resume
  - Statistics tracking: download speeds, sizes, ETA calculations

- Created comprehensive unit tests (test_download_service.py)
  - 23 tests covering all service functionality
  - Tests for queue management, persistence, retry logic
  - Broadcast callbacks, error handling, and lifecycle

- Added structlog dependency for structured logging
- Updated infrastructure.md with download service documentation
- Removed completed task from instructions.md

All tests passing (23/23)
2025-10-17 10:07:16 +02:00
2867ebae09 health check 2025-10-12 23:06:29 +02:00
7481a33c15 instruction2 2025-10-12 22:39:51 +02:00
888acfd33d Remove unused Flask imports and dependencies - Cleaned up old Flask middleware files and updated requirements.txt with FastAPI dependencies 2025-10-06 09:08:49 +02:00
082d725d91 Test web routes and fix import dependencies - Added missing packages and verified route functionality 2025-10-06 09:03:37 +02:00
85f2d2c6f7 cleanup 2 2025-10-05 22:22:04 +02:00
78fc6068fb new folder structure 2025-09-29 09:17:13 +02:00
fa994f7398 second server version 2025-09-28 19:24:14 +02:00
60ac14e151 added better progressbar 2025-09-27 20:21:05 +02:00
22ee445b7e backup 2025-05-30 17:30:32 +02:00
1bc13e7cb0 first version 2025-05-01 21:42:57 +02:00