Skip to content

ShokoBridge v5.0.0 - The Complete Rewrite

Choose a tag to compare

@r33Cy r33Cy released this 04 Jul 20:37
· 5 commits to main since this release

This release marks a complete, ground-up rewrite of ShokoBridge, evolving it from a single monolithic script into a robust, modular, and maintainable application. The focus of this release is on reliability, testability, and a vastly improved user experience.


🏗️ Major Architectural Overhaul

Contrasting with the previous version, which was a single ~400-line script, the project is now a structured Python package with a clear separation of concerns:

  • 📦 Monolith to Modular: The single ShokoBridge.py has been replaced by a shokobridge/ package. The core logic now resides in bridge.py, which orchestrates dedicated manager and client classes.
  • 📡 Dedicated Clients: API interactions are now handled by clients/shoko.py and clients/tmdb.py, which manage requests, caching, and data parsing.
  • 📁 Filesystem Abstraction: All file operations (linking, moving, cleaning) are now managed by file_manager.py, which also handles transactional processing for media and supplemental files.
  • 🗃️ Database Manager: All SQLite logic is now encapsulated within database.py, providing a clean interface for state management.

🧪 Unprecedented Reliability and Testing

For the first time, ShokoBridge has a comprehensive test suite, ensuring stability and preventing regressions.

  • ✅ Full Test Coverage: Over 20 unit tests have been introduced, covering the core application logic, database operations, and file management.
  • 🎭 Mocked Dependencies: Tests use extensive mocking to ensure they are fast, reliable, and independent of external services.
  • 🛡️ Graceful Error Handling: The new architecture allows the application to handle errors gracefully, logging issues to a report file and continuing its run without crashing.

📚 Documentation and User Experience

The user-facing documentation and setup process have been completely revamped for clarity and ease of use.

  • 📖 Overhauled README.md: The documentation is now a comprehensive guide covering the "why," features, and a clear, step-by-step setup for both Docker and Manual installations.
  • 🐳 Streamlined Docker Setup: The docker-compose.yml is now clearer and better documented. All persistent data is centralized into a single ./data volume mount, simplifying setup and backups.
  • ⚙️ Clearer Configuration: The config.json and its documentation have been refined to be more intuitive.

✨ Enhanced Features

  • 🔄 Transactional File Groups: The script now processes a media file and all its supplemental files (e.g., .srt, .ass) as a single atomic unit. If any part fails, the entire group is rolled back.
  • 🧠 Smarter Fallbacks: The script now includes more intelligent fallback mechanisms, such as title-similarity matching for episodes that lack a direct TMDb ID.
  • 🎬 Improved Movie Pathing: Correctly handles movie placement in a subfolder of the main destination if a separate movie destination is not specified.