Skip to content

Repository files navigation

phlix-plugin-omdb

tests

OMDb metadata provider for Phlix — IMDb/RT/Metascore ratings aggregation for movies and TV.

Queries the OMDb API to enrich Phlix media items with IMDb ID, Rotten Tomatoes critic rating, and Metascore ratings. Ratings are returned under the valid metadata_ratings.source ENUM values (imdb, rt); the host resolver owns writing them and Phlix's rating aggregation.

Features

  • IMDb ID resolution — search by title + year to resolve the canonical IMDb ID
  • Multi-source ratings — captures IMDb and Rotten Tomatoes scores (Metascore is dropped — no valid metadata_ratings.source ENUM member)
  • Non-blocking HTTP — async HTTPS-only client compatible with Workerman's event loop
  • Rate limiting — configurable request throttling to respect OMDb API limits
  • Response caching — configurable in-memory cache TTL to reduce API calls
  • TLS verification toggle — option to disable SSL verification for self-hosted proxies
  • Pure readgetDetails() fetches and shapes data only; onEnable() does no network or DB I/O and never throws on a missing key

Install

The plugin is unsigned by design — install via the Phlix admin UI:

  1. Log in to your Phlix server as an admin user (users.is_admin = 1).

  2. Browse to /admin/plugins.

  3. Paste this URL into the Install from URL form and submit:

    https://raw.githubusercontent.com/detain/phlix-plugin-omdb/main/plugin.json
    
  4. The server downloads the manifest, validates it, runs composer install --no-dev, and stores a row in the plugins table. The plugin lands disabled by default.

  5. Flip the toggle in the table to enable it.

  6. Enter your OMDb API key in the plugin settings (get one at https://www.omdbapi.com/apikey.aspx).

Settings

Setting Type Required Secret Tier Default Description
enabled boolean No No standard false Master on/off for OMDb rating enrichment. Optional; default off.
api_key string Yes Yes standard null Your OMDb API key. The free tier allows 1,000 requests/day.
use_ssl_verification boolean No No advanced true Verify OMDb's TLS certificate. Optional; default on. Leave on unless debugging.
cache_ttl_seconds integer No No advanced 86400 How long to cache OMDb responses. Optional; default 86400 (24 hours).

Where to get your OMDb API key

The api_key setting is required. Request a free key at https://www.omdbapi.com/apikey.aspx — the free tier allows 1,000 requests/day.

What it does

When enabled, the plugin registers as a MetadataSourceInterface provider. When the Phlix metadata manager requests details for a media item:

  1. The plugin receives the search query (title + optional year)
  2. It queries OMDb's search endpoint to find matching entries
  3. It fetches full details including ratings for the selected IMDb ID
  4. Ratings are returned as a ratings list using the metadata_ratings.source ENUM values (imdb, rt) for the host resolver to persist and aggregate

Supported media types

  • movie
  • series

Running tests locally

composer install
vendor/bin/phpunit
vendor/bin/phpstan analyse src --level=9
vendor/bin/phpcs src --standard=PSR12

License

MIT — see LICENSE.

Releases

Packages

Used by

Contributors

Languages