Skip to content

v3.1.0

Latest

Choose a tag to compare

@FastZet FastZet released this 13 Sep 11:03
· 2 commits to main since this release
481e148

🚀 The Quick Reviewer 3.1.0 Released

feat: Introduces Persistent Database Caching and Graceful Shutdown

Description:

This release merges significant architectural upgrades from the devel branch into main. The primary change is the introduction of a persistent storage layer, moving from a volatile in-memory cache to a robust database-backed system. This ensures that generated reviews persist across application restarts, reducing redundant API calls and improving long-term performance.

Additionally, this update introduces proper server lifecycle management, including graceful shutdown and periodic cache cleanup, to enhance the addon's stability and reliability.


✨ Features

  • Persistent Caching Layer (/src/core/storage.js)

    • A new unified storage module has been added to replace the previous in-memory cache.
    • SQLite & PostgreSQL Support: The addon can now use SQLite or PostgreSQL for caching by setting a DATABASE_URI environment variable. This allows reviews to persist permanently.
    • Graceful Fallback: If DATABASE_URI is not provided or fails to connect, the system automatically falls back to the original in-memory caching behavior without interrupting service.
  • Enhanced Server Reliability (/server.js)

    • Graceful Shutdown: The server now correctly handles SIGTERM and SIGINT signals to close database connections and shut down cleanly.
    • Periodic Cleanup: A background job now runs every 6 hours to automatically clean up expired review entries from the cache or database.
    • Process Management: Added handlers for uncaughtException and unhandledRejection to improve server stability.

🐛 Bug Fixes & Improvements

  • Corrected Stream URL: Fixed a bug in /src/core/stremioStreamer.js where URL query parameters in the review link were incorrectly separated by & instead of &, which could cause issues in some clients.
  • Updated Docker Image: The Dockerfile has been switched from node:24-alpine to node:24-slim (Debian) to ensure compatibility with native dependencies required by better-sqlite3.
  • Asynchronous API Endpoints: The API routes that interact with the cache (/api/cached-reviews) are now asynchronous to properly support database operations.
  • New Dependencies: Added better-sqlite3 and pg to package.json to support the new database backends.