Resolve Alembic paths relative to the services directory, load DATABASE_URL from the project .env, and normalize async PostgreSQL URLs before migrations run.
Also extract shared database URL helpers and cover the behavior with database tests.
- delete the dead run_alembic_migration helper and the unused FastAPI-style get_session generator
- simplify DB tests accordingly
- drop the completed dead-code finding from the review backlog
- add TTL and max-size pruning for pending requests, inline video requests, album links, and DB caches
- keep fail-soft settings fallback while preventing unbounded in-memory growth
- update code_review backlog to drop the completed eviction finding
- Introduced caching for statistics snapshots and charts to improve performance.
- Refactored the statistics fetching logic to aggregate data by service and date.
- Updated the chart rendering function to return PNG bytes directly without filesystem writes.
- Added new inline keyboard for statistics with options to toggle between total and split views.
- Improved test coverage for statistics-related functionalities, including fetching and rendering.
- add Pinterest handler via Cobalt with inline support and tests
- extract reusable Cobalt media helpers and inline album deeplink storage
- add public reusable album deep-links handled from /start without default welcome
- unify inline photo/album copy in user messages and ensure Powered by MaxLoad captions
- add single-photo inline behavior with info keyboard across Instagram/TikTok/Pinterest
- include related stats/service wiring updates and regression tests
- Added try-except block in the stats command to handle exceptions and log errors.
- Updated logging to capture exceptions when generating stats.
Refactor YouTube download handler for improved error handling and type safety
- Introduced safe_int function to handle integer conversions safely.
- Updated download_video and inline_youtube_query functions to use safe_int for view and like counts.
- Removed custom OAuth verifier function and related code.
Simplify video info keyboard function
- Removed unused full_quality_callback parameter from return_video_info_keyboard function.
Update requirements for PostgreSQL support
- Added psycopg2-binary and asyncpg to requirements.txt for PostgreSQL database support.
- Added pytest-asyncio for async testing.
Update Alembic configuration for environment-based database URL
- Changed sqlalchemy.url in alembic.ini to use environment variable DATABASE_URL.
Refactor database connection to support PostgreSQL
- Updated db.py to use BigInteger for primary keys and adapt to PostgreSQL.
- Implemented asyncpg for asynchronous database operations.
- Added sequence adjustments for PostgreSQL after migrations.
Add migration script from SQLite to PostgreSQL
- Created migrate_sqlite_to_postgres.py to facilitate data migration from SQLite to PostgreSQL.
Implement a resilient downloader service
- Added download_manager.py with a ResilientDownloader class for robust file downloading.
- Supports multipart downloads, retries, and resuming interrupted downloads.
Refactor tests to accommodate new database and downloader structure
- Updated test_db.py to use DATABASE_URL for database connection in tests.
- Refactored Instagram handler tests to use the new InstagramService for downloading videos.